Hi there, I've a problem with Hibernate 2 that I'm really struggling with
I've got the following tables/mappings:
LineOfBusinessDetails, which has a fk column of lineOfBusiness (into table LineOfBusiness)
LineOfBusiness which has a fk column of businessUnit (into table BusinessUnit
BusinessUnit table, which has name on it.
What I need to do, using the Criteria API is use an expression of the following type:
Code:
Criteria crit=Criteria.create(LineOfBusinessDetails.class);
crit.add(Expression.eq("lineOfBusiness.businessUnit.name","a name");
Apologies for the somewhat pseudo nature of the code.
However, I can't get the 2 level join to work correctly. I have tried all ways of creating alias etc but with no luck.
Can someone help please!