-->
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: Inner join problem
PostPosted: Mon Jan 30, 2006 5:20 pm 
Beginner
Beginner

Joined: Tue Dec 20, 2005 9:40 pm
Posts: 20
NHibernate.QueryException: could not resolve property:Album of :MyApp.Domain.Order.OrderItem [from MyApp.Domain.Order.OrderItem as orderItem join orderItem.Product as track join track.Album as album where album.Artist.ID = ? and orderItem.Product.class = 5]

I can't figure out what the problem here is. Is it perhaps it's trying to join on classes which aren't 5? Here's my query and my mappings:

from OrderItem as orderItem
join orderItem.Product as track
join track.Album as album
where album.Artist.ID = 212 and orderItem.Product.class = 5

In the OrderItem class I have:

<any name="Product"
meta-type="Int32"
id-type="Int32">
<meta-value class="MyApp.Domain.Track, MyApp.Domain" value="5"/>
<meta-value class="MyApp.Domain.Ringtone, MyApp.Domain" value="6"/>
<column name="item_type"/>
<column name="item_id"/>
</any>

Here's the track mapping:

<class name="MyApp.Domain.Track, MyApp.Domain" table="Track">
<id name="_ID" column="Track_id" access="field" type="Int32" unsaved-value="-1">
<generator class="native"/>
</id>
<many-to-one
name="Album"
column="Album_id"
not-null="true"/>
</class>


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.