-->
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: Mapping a Collection to inherited classes
PostPosted: Thu Apr 22, 2004 4:35 am 
Newbie

Joined: Thu Apr 22, 2004 4:19 am
Posts: 6
I have an object model like the one in chapter 18.2 (Author/Work). In that example, there is a collection in Author class to get the works made by a concrete author:

<set name="works" table="author_work" inverse="true" lazy="true">
<key column="author_id"/>
<many-to-many class="Work" column="work_id"/>
</set>

But how can I do a mapping to get directly, for example, all the books written by an author? I mean, a method like getBooks() in class Author. In my concrete problem I'm using table-per-subclass mapping, so the database structure is something different.

Thanks!


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.