Enable joining the same association twice with Criteria

Description

Make double joining the same association with Criteria.createCriteria possible. See: http://forum.hibernate.org/viewtopic.php?t=931249

Environment

None

Activity

Show:
Mauro Molinari
April 2, 2020, 4:46 PM

Today I encountered this… very annoying. I would need to join the same association multiple times (with different meanings and different additional join criteria), but hit this problem. Sad to see it’s still unresolved… and probably will ever be, since the Hibernate Criteria API is deprecated AFAIK.

Milad Khajavi
October 10, 2016, 3:05 AM

Any effort to fix this issue?

Suganthan Madhavan
January 19, 2015, 4:36 PM
Edited

Any valid solution for this issue? I got stuck in a similiar issue. http://stackoverflow.com/questions/28029158/grails-join-association-twice-in-criteria-api

Manuel Dominguez Sarmiento
November 13, 2014, 12:51 PM

I've attached a DetachedCriteria replacement/extension that deals with duplicate association paths, as long as the join type or alias is the same. Otherwise the same exception as usual occurs.

Simon Oualid
April 18, 2011, 2:09 AM

Simplest workaround I found :

Regards.

Assignee

Unassigned

Reporter

Vladimir Bayanov

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Priority

Major