-
Notifications
You must be signed in to change notification settings - Fork 230
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
Query.bind implementation && behavior #80
Comments
I haven't used the Also, what's the benefit of the marker interface in this case over a plain Object? |
if (obj instanceof ParamObject){
// analyze fields and put them as param values
} else {
// analyze getXXXX methods (bean-style) and put them as param values
} |
The inheritance issue should be fixed. It is also described in issue #55. When binding objects, we should only bind expected parameters. So if we have 2 parameters in the sql-statement, but 3 properties on the binded object, it should only bind the 2 parameters and ignore the last property. It seems like this behavior has been changed recently from the original implementation of bind(). as @dimzon points out, it will throw exception if this happens today! This should be fixed. Given the above, I don't think the changes suggested will break backwards-compatibility? If we add analysis of fields (in addion to getters), we don't need the ParamObject interface. Then it should work with:
as well as with:
|
who will do this (I can but if anyone else want feel free to stop me) |
@dimzon - Your on a killing spree :) BTW, you deserve your name under developers in the pom.xml file (If you would like it there, of cause - no pressure :) You have been a really valuable contributor! Without you and @aldenquimby, sql2o would never have been able to become such an awesome project! |
btw - When fixing an issue like this. I would recommend creating a new branch just needed for the fix.
Do your stuff, and check it in with a commentary that mensions the issue number, like this: "ref #80 - comment here".
On github, create a pull request from the new branch. This way you can start on working on other things, and not have to wait for me to merge in your work. |
https://github.com/aaberg/sql2o/blob/master/core/src/main/java/org/sql2o/Query.java#L219
java.beans.Introspector
do - why not just reuse it?some fixes will definitly cause backward compatibility breaks ;(
so I propose
bind
as is and mark it@Deprecated
bindObject
with proper implementation and behaviorParamObject
The text was updated successfully, but these errors were encountered: