original code:
caseUsers = criteria.createAlias(“user”,“u”).disjunction([criteria.restrictions.ILIKE(“u.firstname”,"%#firstname#%"),criteria.restrictions.ILIKE(“u.lastname”,"%#lastname#%")]).list(sortOrder=“u.firstname ASC, u.lastname ASC”,asQuery=false);
my entity had an association to “user” and using aliases, get all entities with users with firstname and lastname LIKE value.
because of my model design, i have to remove the orm relationship to users and now just have a regular property in the entity:
property name=“userID” sqltype=“integer” notnull=true;
because of this, the criteria query now fails.
what is the best way to create a join criteria between the entity and to be able to get all entities based on the user firstname/lastname?