erikvaningen wrote:
I am not answering the question directly because I don't know the answer. But it sounds like you trying to solve a missing link in your domain model with Hibernate. Is it possible to go back to your domain model and and this relation/behaviour in a proper way?
Well we are porting from OJB to JPA. OJB only had XML mappings so if you put a mapping on an entity, that extends a common base class of functionality, you got the mapping. If you didn't for another entity, the mapping won't be there. The object being mapped is in the base class so you can see how this is optional relationships... and we did this to give our customers an easy way to extend our product by merely adding an XML mapping to an entity they provide.
It seems like the annotations just are not that flexible.
Thanks for you thoughts though!