Hey there Jochen,
I have never answered a question on any forums before but have been working on hibernate for the last 9 months or so. So bare with me. :)
I am almost certain you may be asking for something a lot more complicated than what I think you are asking. But for what I think you are asking, let me answer you this way.
Most inverse relationships for a one-to-many relationship are done through the mapped-by attribute of the many-to-one side of things. here's a code snippet based on your example.
Code:
@Table("person")
public class Person
{
...
List personAddresses;
...
@OneToMany(...) //using the forward join by using column to join...
public List getPersonAddresses()
{
return address;
}
...
...
}
then on the inverse side
Code:
public class Address
{
...
private Address personWhoseAddressThisIs;
...
@ManyToOne(mappedBy="personAddresses")
public Address getPersonWhoseAddressThisIs()
{
return personWhoseAddressThisIs;
}
...
...
}
That should do it, so when you retrieve person all the list of address will be in there and when you retrieve address the person whose address it is, will be residing inside your java class.
So hope this helps. If this isn't what you were asking for feel free to elaborate and maybe we could work towards a solution together. :)
Regards,
Ramon