I have an entity Person
with property employers
which is collection (and other profile information such as full name). Also I have an entity Employers
with property employers
which is collection too (and also some general information such as name). It is a many-to-many bidirectional association (I want both to get employers associated with a person and employees associated with the employer). Now I want to associate some data with a mapping (e.g. job position or when the person was hired).
The original idea was to create a class which extends Employer
and adds required properties. But this is not possible because it is a bidirectional association.
Other idea is to create a new Entity which has references to Person
, Employer
and required properties (e.g. job position). I can't see any disadvantages at the moment in this solution.
Is there a better way to do it (in other words, are there potential disadvantage that I missed)?