Beginner |
|
Joined: Wed Nov 17, 2004 11:15 am Posts: 25
|
Hi,
I've got a query: select spfli.sflights.planetype from de.model.sap.Spfli as spfli
This query works in the "HQL Editor View" from the tools. But using this query in my application throws an error, that the property sflights could not be resolved.
What am I missing here? (Mapping-file and exception below)
Thanks
Jonny
Hibernate version:3.0.2
Mapping documents: Spfli.hbm.xml: <?xml version="1.0"?> ... <hibernate-mapping> <class name="de.model.sap.Spfli" table="spfli"> <composite-id name="id" class="de.model.sap.SpfliId"> <key-many-to-one name="scarr" class="de.model.sap.Scarr"> <column name="carrid" length="5" /> </key-many-to-one> <key-property name="connid" type="string"> <column name="connid" length="5" /> </key-property> </composite-id> <property name="airpfrom" type="string"> <column name="airpfrom" length="45" not-null="true" /> </property> ... <set name="sflights" inverse="true"> <key> <column name="carrid" length="5" not-null="true" /> <column name="connid" length="5" not-null="true" /> </key> <one-to-many class="de.model.sap.Sflight" /> </set> </class> </hibernate-mapping>
Sflight.hbm.xml: <?xml version="1.0"?> ... <hibernate-mapping> <class name="de.model.sap.Sflight" table="sflight"> <composite-id name="id" class="de.model.sap.SflightId"> <key-many-to-one name="spfli" class="de.model.sap.Spfli"> <column name="carrid" length="5" /> <column name="connid" length="5" /> </key-many-to-one> <key-property name="fldate" type="date"> <column name="fldate" length="10" /> </key-property> </composite-id> </property> <property name="planetype" type="string"> <column name="planetype" length="20" not-null="true" /> </property> ... </class> </hibernate-mapping>
Full stack trace of any exception that occurs:
org.hibernate.QueryException: could not resolve property: sflights of: de.model.sap.Spfli [select spfli.sflights.planetype from de.model.sap.Spfli as spfli]
|
|