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: Is there a better way to model this?
PostPosted: Mon Aug 21, 2006 7:41 pm 
Beginner
Beginner

Joined: Fri Jul 22, 2005 4:08 pm
Posts: 28
Since my real domain model would take too long to explain, I'll use an abstract example that shows the same problem:

Let's say I have a permission system where I want to be able to assign permissions (think Windows ACLs) to securable objects. Say I've got 5 classes, one for each type of securable object in my domain and an abstract base class called SecurableObject. Right now I have SecurableObject mapped and the 5 derived classes mapped with a <joined-subclass>. SecurableObject has a collection of PermissionEntry objects that I use in my authorization checks.

My questions are:

1) I could unmap the SecurableObject class and just have 5 'table per concrete class' mappings, but then wouldn't I have to define 5 PermissionEntry classes, one for each object type so they would map correctly?

2) Is there a better pattern for this that I'm just not seeing? I'm worried about performance here of the added inner join or should I not be too worried since the SecurableObject table is going to be extremely small (an Id and maybe a Name column)?


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.