-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: HQL - Query works in "HQL Editor View", but not in
PostPosted: Sun Jun 19, 2005 2:39 pm 
Beginner
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]


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.