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.  [ 2 posts ] 
Author Message
 Post subject: Error mapping collection of Enums
PostPosted: Tue Sep 28, 2010 7:42 pm 
Newbie

Joined: Tue Sep 28, 2010 7:31 pm
Posts: 5
Hi All,

I'm having trouble mapping a collection of enums and would appreciate any help you can provide.
I am using the standard StringEnumUserType to persist enum properties but this does not work with collections of enums

Cheers,
Nim

Enum class:
Code:
public enum Authority {
   ROLE_USER, ROLE_ADMIN;
}


Mapping:
Code:
<typedef class="persistence.StringEnumUserType" name="authority">
   <param name="enumClassname">domain.Authority</param>
</typedef>

<set name="authorities" table="AUTHORITIES" lazy="true" cascade="all">
   <key column="USER_ID" not-null="true"/>
   <element type="authority" column="AUTHORITY" not-null="true"/>
</set?


Top
 Profile  
 
 Post subject: Re: Error mapping collection of Enums
PostPosted: Tue Sep 28, 2010 7:49 pm 
Newbie

Joined: Tue Sep 28, 2010 7:31 pm
Posts: 5
oops... my fault. The mapping works. I was not refreshing the xml files before creating the database tables - still getting used to Maven :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.