Path « Association « JPA Q&A

1. Duplicate Association Path Error in Hibernate

I've run into an issue when I try to programmatically build a Criteria object based on a user's search criteria. Simply put, the user can enter one or more search criteria ...

2. duplicate association path

3. more on criteria and dotted association paths

public List getObjects(final Class clazz, final String orderBy, final boolean ascending, final Map parameters) { HibernateTemplate template = getHibernateTemplate(); return template.executeFind(new HibernateCallback() { public Object doInHibernate(Session session) ...

4. duplicate association path QueryException

I'm getting the duplicate association path on the following search query: ... rootCriteria = session.createCriteria(Entity.class); rootCriteria.add(Restrictions.eq("entityTypeId", entityTypeId)); Criteria criteria2 = rootCriteria.createCriteria ("attributes","Attribute1"); criteria2.add(Restrictions.eq("entityAttributeTypeId",160004)); criteria2.add(Restrictions.eq("booleanValue",1)); matchedEntities = updateMatchedEntities(matchedEntities, rootCriteria.list()); the call to list() results in the QueryException being thrown. I don't see any relevant docs on the web, what am I likely doing wrong?

5. duplicate association path

Hi, I have a problem with Criteria object. No matter if I use the approach that embeds a criteria in a criteria or I use createAlias when I try to fetch something in a join table, I always get this exception: org.hibernate.QueryException: duplicate association path See the exemple below that comes from the hibernate documentation: 15.4. Associations You may easily specify ...