-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Modeling qualified relations in Hibernate
PostPosted: Tue Mar 04, 2014 5:31 am 
Newbie

Joined: Wed Aug 29, 2012 6:45 am
Posts: 3
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:

Image

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?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.