I think you probably want to implement a bidirectional association there. There may be a circumstance that you would want to navigate the domain graph from Author to Publisher. Instead of this in your Author mapping:
Code:
<property name="publisherId" type="java.lang.Long">
<column name="PUBLISHER_ID" precision="22" scale="0" />
</property>
Do this:
Code:
<many-to-one name="publisher" class="Publisher">
<column name="PUBLISHER_ID" precision="22" scale="0" />
</property>
In the Publisher mapping, add inverse="true" to the set of Authors.
You will, of course, have to change your mapping files, changing the Author POJO from Long publisherId to Publisher publisher.
Also, you should add bidirectional association management routines in your POJO, as such (Publisher):
Code:
public void addAuthor(Author author) {
if (authors == null) {
authors = new HashSet();
}
authors.add(author);
author.setPublisher(this);
}
I leave it up to you to define an equivalent removeAuthor method.
More information on bi-directional associations here.