]
Tsering Shrestha commented on HHH-4893:
---------------------------------------
Considering the fact that a Criteria-query is ultimately translated to a SQL query and the
latter does support multiple joins, maybe we could start working on that.
Multiple Joins using criteria
-----------------------------
Key: HHH-4893
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-4893
Project: Hibernate Core
Issue Type: Bug
Components: query-criteria
Affects Versions: 3.3.2
Reporter: praveer gupta
I need to do multiple joins between two tables using Hibernate criteria.
I tried doing the following:
Crtieria criteria = session.createCriteria(Cat.class, "cat");
criteria.createAlias("cat.kittens", "first",
CriteriaSpecification.LEFT_JOIN)
.add( Restrictions.eq("first.name", "Foo"));
criteria.createAlias("cat.kittens", "second",
CriteriaSpecification.LEFT_JOIN)
.add( Restrictions.eq("second.name", "Bar"));
criteria.list();
I get the following: org.hibernate.QueryException: duplicate association path
I tried looking for issues regarding the same and found
http://opensource.atlassian.com/projects/hibernate/browse/HB-555.
I am not aware whether we can do multiple joins using criteria now.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: