From: <leg...@at...> - 2003-08-14 14:10:21
|
The following comment has been added to this issue: Author: Gavin King Created: Thu, 14 Aug 2003 9:03 AM Body: You need to submit a whole main() method. I tried to reproduce this problem in my test suite, but it all seems to work beautifully for me: s.find("from Outer o where o.id.master.id.sup.dudu is not null"); s.find("from Outer o where o.id.master.id.sup.id.akey is not null"); s.find("from Inner i where i.backOut.id.master.id.sup.id.akey = i.id.bkey"); --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-259 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-259 Summary: HQL queries doesn't work with compositeIds composed by others compositeIds Type: Bug Status: Unassigned Priority: Minor Project: Hibernate2 Versions: 2.0 final 2.0.1 2.0.2 Assignee: Reporter: benoit lafontaine Created: Thu, 14 Aug 2003 8:07 AM Updated: Thu, 14 Aug 2003 8:07 AM Description: With the following mapping (and corresponding classes) the query : SELECT a.id, a.libelleLong, a.categorieProduit.id.secteurEditorial.id.editeur.id FROM a in class Article WHERE a.categorieProduit.id.secteurEditorial.id.editeur.id = '150' does not work (and should). -------------------------------- Article.hbm.xml <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd"> /> <hibernate-mapping> <class name="exemple.articles.Article" table="LPR_PROD_DIST" proxy="exemple.articles.Article" dynamic-update="false" mutable="false" > <jcs-cache usage="read-only" /> <id name="id" column="NPROD" type="java.lang.String" unsaved-value="none" > <generator class="assigned"> </generator> </id> <property name="libelleLong" type="java.lang.String" update="true" insert="true" column="LIBLONG" /> <many-to-one name="categorieProduit" class="exemple.articles.CategorieProduit" cascade="none" outer-join="auto" update="true" insert="true" > <column name="CATPROD" /> <column name="SECTED" /> <column name="EDITR" /> </many-to-one> </class> </hibernate-mapping> ------------------------------------------ categorieProduit : <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd"> /> <hibernate-mapping> <class name="exemple.articles.CategorieProduit" table="LPR_CATG_PRODUIT" dynamic-update="false" mutable="false" proxy="exemple.articles.CategorieProduit" > <jcs-cache usage="read-only" /> <composite-id name="id" class="exemple.articles.CategorieProduitCompositeId" unsaved-value="none" > <key-property name="categorieProduitId" type="int" column="CATPROD" /> <key-many-to-one name="secteurEditorial" class="exemple.articles.SecteurEditorial" > <column name="SECTED"/> <column name="EDITR"/> </key-many-to-one> </composite-id> <property name="libelleLong" type="java.lang.String" update="true" insert="true" column="LIBLONG" /> </class> </hibernate-mapping> --------------------------------------- secteurEditorial <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd"> /> <hibernate-mapping> <class name="exemple.articles.SecteurEditorial" table="LPR_SECT_EDITORIAL" dynamic-update="false" mutable="false" > <jcs-cache usage="read-only" /> <composite-id name="id" class="exemple.articles.SecteurEditorialCompositeId" unsaved-value="none" > <key-property name="secteurEditorialId" type="int" column="SECTED" /> <key-many-to-one name="editeur" class="exemple.articles.Editeur" column="EDITR" /> </composite-id> <property name="libelleLong" type="java.lang.String" update="true" insert="true" column="LIBLONG" /> </class> </hibernate-mapping> ------------------------------------------ editeur: <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd"> /> <hibernate-mapping> <class name="exemple.articles.Editeur" table="LPR_EDITEUR" dynamic-update="false" mutable="false" > <jcs-cache usage="read-only" /> <id name="id" column="EDITR" type="java.lang.String" unsaved-value="none" > <generator class="assigned"> </generator> </id> <property name="nom" type="java.lang.String" update="true" insert="true" column="LEDIT1" /> </class> </hibernate-mapping> --------------------------------------------------------------------- JIRA INFORMATION: 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 If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |