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!
|