Get Criteria by associationPath

Posted by niklassaers on Stack Overflow See other posts from Stack Overflow or by niklassaers
Published on 2009-11-27T14:28:46Z Indexed on 2010/05/01 3:57 UTC
Read the original article Hit count: 325

Filed under:
|

Hi guys,

Every so often, I get a "org.hibernate.QueryException: duplicate association path: myAssociation". This is because the complex criteria I'm working with can define the same path in many places. I'd love to do something like

Criteria association = myCriteria.getAssociation("wax");
if(association == null) association = myCriteria.createCriteria("wax");

Is there any such way that I can check if an association is already in place?

Cheers

Nik

© Stack Overflow or respective owner

Related posts about hibernate

Related posts about java