-->
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.  [ 3 posts ] 
Author Message
 Post subject: Collection of PersistentEnum?
PostPosted: Fri Jun 10, 2005 2:29 pm 
Beginner
Beginner

Joined: Fri Jun 10, 2005 2:22 pm
Posts: 27
I'm having a problem trying to map a persistent enumeration into a collection using Hibernate 2.1.7, and I haven't been able to find any examples that would help me out. Thought I'd ask about it here.

I have a class that represents a User and I need to associate with that user a collection of Privileges. The Privileges are currently defined as a persistent enumeration (using the UserType method) because it doesn't make sense to put them into a database table. So, I anticipate having a one-to-many relationship between User and Privilege, but when I try to generate the schema for my database there is no mapping for the Privilege object, so it fails to build the proper association. The table "UserPrivilege" should contain the User_id and the Privilege_id.

Any thoughts?
Thanks!
David


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 10, 2005 3:43 pm 
Newbie

Joined: Tue May 24, 2005 9:03 am
Posts: 3
I have the same question and hope someone will happen along who knows the answer.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 10, 2005 3:49 pm 
Beginner
Beginner

Joined: Fri Jun 10, 2005 2:22 pm
Posts: 27
The best I've come up with, so far, is to wrap it up in another object that is truly persistent, but that's rather clunky and it's having trouble loading a persisted object anyway. Seems like there's got to be a relatively easy way to handle this. I would think it'd be a fairly common problem.


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

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.