I have a relational model where entities usually have relationships with two qualifiers, start_date and end_date, so to keep a history of past relationships.
When presented with the task of creating a data model with Hibernate, I faced the problem of dealing with these relationships that break the usual many-to-many relationship case. For instance let's say a user can have a certain access permission (which is in fact a real case), and we want to model the history of permissions a user has had:
Now how would you do this in a class model? What one would do in a regular case, creating a User class with a list of Permissions is no longer valid. Given that I have lots of entities, I don't want to end up with lots of "HasX" classes that only hold up another reference plus the startDate and the endDate.
Whats the common way to solve this problem?