Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the use of <set> tag may occur exceptions,for the the field of the domain is primitive type. #15

Open
peiquan opened this issue Feb 1, 2015 · 0 comments

Comments

@peiquan
Copy link

peiquan commented Feb 1, 2015

For example,in the koan21-mapper.xml ,given below sql can't pass the test(Koan21#learnToUseDynamicSetTagToAllowVariableNumberOfSetClauses)..

<!-- SET -->
 UPDATE film
<set>
    <if test="title != null">
        title=#{title},
    </if>
    <if test="retal_duration != null">
        rental_duration=#{rentalDuration},
    </if>
    <if test="rentalRate != null">
        rental_rate=#{rentalRate}
    </if>
</set>
WHERE film_id = #{id}
<!-- use dynamic sql clause(s) to optionally update title, rental_duration and/or rental_rate -->

maybe,I haven't understood the mybatis

sometimes,i also find something interesting.While you just only pass the id arg on the domain Film,the sql will be UPDATE film WHERE film_id = ?, it's a bad sql

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant