Hi,
the following scenario:
a simple class Person with no special properties and a class PersonRelation with properties PersonA and PersonB and RelationType.
An example would be
Person john = new Person("john");
Person george = new Person("george");
PersonRelation relation = new PersonRelation(john, george, "friends");
this maps in to DB just fine.
But now I want to add a Set to the Person object containing all the PersonRelations it is member of. And the problem I'm now facing is that the Set's key column might be the PersonA or PersonB.
Is there an easy way to tell hibernate to look in both columns (PersonA and PersonB) to find the key?
To me it seems not possible, but I also know that hibernate has some hidden killer-features :-)
thanks in advance
|