It is unfortunate that you cannot use QBE for associations.
I have a large amount of data consisting of 8 many-to-one columns. There is a drop-down list for each column to expand the table.
Assume the following:
Table user
User { id, UserStatus, UserAuthorization }
I want to use this code:
Criteria crit = getSession().createCriteria(class);
crit.add(Example.create(userObject));
This does not work in the following example userObject:
User id=1 { UserStatus=Active, UserAuthorization=Admin }
because QBE does not support collections.
One way to solve this problem is to use it as follows:
crit.createCriteria("UserStatus").add(Example.create(userStatusObject));
crit.createCriteria("UserAuthorization").add(Example.create(userAuthorizationObject));
My question is how can this be programmed dynamically only with a given object User. Is there any other way than using QBE?
source
share