-->
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: Query with <any> mapping
PostPosted: Fri Oct 29, 2004 10:40 am 
Newbie

Joined: Fri Oct 29, 2004 10:29 am
Posts: 4
How does one do a find() with a polymorphic table-per-contrete-class strategy? By that I mean, what is the hibernate type in the query?

My mapping in Grade.hbm.xml is:

<any name="parent" id-type="long" meta-type="edu.academyart.model.GradableTypeManager">
<column name="parentType"/>
<column name="parentId"/>
</any>

and I want to match a very specific parent:

return hibernate.find(
"from Grade as grade where grade.parent= ? and grade.course = ? ",...)


I can't use a hibernate.entity; I get "path expression ends in a composite value." Do I have to do parent.id=? and parent.class=?, even though I have a user type that knows how to convert these things for me?


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.