Hi,
I have a problem when I do a query by example on a field that had a many to one relation.
Code:
user = new UserDO();
user.setName("Jean");
users = userDAO.getUsers(user);
This works fine, and will create a query like "... where (this_.NAME=?)" and will hence return a list of users with name "Jean".
However, when I do this:
Code:
AddressDO address = new AddressDO();
address.setStreet("some street");
user = new UserDO();
user.setAddress(address);
users = userDAO.getUsers(user);
This will not work and create a query like "... where (1=1)"
There is a many to one relation between address and user:
Code:
<many-to-one name="address" class="package.AddressDO" fetch="select">
<column name="ADDRESS_ID"/>
</many-to-one>
Is there any way to get this to work?
TIA