I was wondering how the following can be solved: Let's say we have 3 entities: A, B, C whose relation is: A uses a collection of C B uses a collection of C. C entity must be mapped to 2 different tables TBL_AC, respective TBL_BC.
Is it a case for inheritance? How should it be done?
It is absolutely the case for Collection mappings. My question was about the definition/mapping of the C entity. The most simple thing to do is to use a component in A, resp. B to describe C, but this results in mapping duplication... and I was asking if this can be refactored ;-).
Originally posted by Gavin King: but I know that you can do it in Hibernate3 (and not in Hibernate 2.1).
LOL Hibernate3 is meant to be some Superman Hibernate? (just kidding).
To clarify my question: Let's take for example a Person - Address relation (1-N) and also Office - Address relation (1-N), in which Address entity *must* be persisted to different tables (the example is not so good :-( - let's say even if Address has the same structure, it has different meanings while related to Person or Office).
My question is about how I can describe in a single place the Address entity? (I think the question is on the field of *joined-subclass* - I should define DefaultAddress and than 2 extends: PersonAddress and OfficeAddress and use them ... hmmm)