cschlaefcke wrote:
Hi Folks,
I try to generate a query with hibernate criterias on a mapping with a composite-id. I set the criteria as I think it should be, but the query then returns nothing :-(
As I can see on the relevant part of my sql-statement (just the where-clause) hibernate tries to set all three values of the composite-id whereas I only set only one value of the composite-id expecting the rest of the values be treated as wildcards.
My question: How can I create a query on that composite-id with my single value and the rest of the c-id as wildcards?
Solved using Expression.sqlRestriction("id = " + myValue);
Regards,
Chris