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

Query.bind() method doesn't include methods from subclasses #55

Closed
aaberg opened this issue Feb 27, 2014 · 1 comment
Closed

Query.bind() method doesn't include methods from subclasses #55

aaberg opened this issue Feb 27, 2014 · 1 comment

Comments

@aaberg
Copy link
Owner

aaberg commented Feb 27, 2014

If you have a base model class:

public class MyBasePojo {
    private int val1;

    public int getVal1() { return val1; }
}

And a class that extends it:

public class MyPojo extends MyBasePojo {
    private int val2;

    public int getVal2() { return val1; }
}

The following will fail:

MyPojo p = getNewInstanceOfMyPojo();
sql2oConnection.createQuery ("insert into mytable(va1, val2) values (:val1, :val2)")
    .bind(p)
    .executeUpdate();

It fails because properties from MyBasePojo are not binded. Only properties declared in the top-level class are binded.

@aaberg
Copy link
Owner Author

aaberg commented Apr 8, 2014

Will be fixed as part of #80

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

No branches or pull requests

2 participants