From: Etienne B. (JIRA) <no...@at...> - 2006-05-11 10:01:12
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-333?page=comments#action_23076 ] Etienne Bernard commented on HHH-333: ------------------------------------- Just so that everyone knows... FROM test.A AS a JOIN a.abs AS ab JOIN index(ab) AS b WHERE ab.status=1 can be replaced with the syntax : FROM test.A AS a JOIN a.abs AS ab JOIN ab.index AS b WHERE ab.status=1 which works perfectly with Hibernate 3.0 and 3.1. This features seems to not be documented. I'm not sure if it's wanted or not but for me it's the only way to perform complex HQL queries involving many-to-many relationships. > QuerySyntaxError when using JOIN index(...) in HQL query > -------------------------------------------------------- > > Key: HHH-333 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-333 > Project: Hibernate3 > Type: Bug > Components: query-hql > Versions: 3.0 final > Reporter: Etienne Bernard > Priority: Minor > > > I've been using this syntax since hibernate 2.0 : > FROM test.A AS a JOIN a.abs AS ab JOIN index(ab) AS b WHERE ab.status=1 > with the following mapping : > [...] > <class name="test.A" table="a"> > [...] > <map name="abs" table="ab" lazy="true"> > <key column="a"></key> > <index-many-to-many class="test.B" column="b"/> > <composite-element class="test.AB"> > <property name="status" type="int"/> > </composite-element> > </map> > [...] > </class> > [...] > It used to work with hibernate 2.1 too. It doesn't work anymore with hibernate 3.0 final. > See the attached example for a complete test case. > Thanks. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |