Joined: Tue Oct 19, 2004 4:05 am Posts: 14 Location: ireland
|
Hi,
I'm trying to join tables mapped to persistant object Story and Plant. My query looks like this:
Query q=session.createQuery("from Story s join s.Plant p where p.id is null");
This code drivers me crazy!. The error I get is: "could not resolve property: Plant of com.delphi.hibernate.Story [from com.delphi.hibernate.Story s left join s.Plant].
What is wrong with this query. It doesn't matter which object is mapped as a first.
Mapping documents:
<hibernate-mapping package="com.delphi.hibernate">
<class name="Story" table="t_story">
<id name="id" column="id" type="java.lang.Integer">
<generator class="sequence"/>
</id>
<property name="fname" column="fname" type="java.lang.String" />
<many-to-one name="plant" column="plant_id" class="Plant" />
</class>
</hibernate-mapping>
<hibernate-mapping package="com.delphi.hibernate">
<class name="Plant" table="t_plant">
<id name="id" column="id" type="java.lang.Integer">
<generator class="sequence"/>
</id>
<property name="name" column="name" type="java.lang.String" not-null="true" />
</class>
</hibernate-mapping>
|
|