-->
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: Allow embedded type information for <element>s.
PostPosted: Tue May 16, 2006 2:25 pm 
Newbie

Joined: Tue May 16, 2006 2:19 pm
Posts: 2
Hi,

I'm using the persistent enum approach that is most easily found on the web to persist a set of enums.

I have this done through an user type, like this:

Code:
        <set name="roles">
            <key column="USER_ID"/>
            <element type="MyRoleUserType" column="ROLE_ID"/>
        </set>


I also have a specialized Hibernate user type called PersistableEnumType, for the various enums in my system. This must be used with a parameter.

I would like to use the generic PersistableEnumType to persist a set of Roles but I cannot because I can't pass the right parameter in when defining an element. This could be easily accomplished if <element> allowed for nested <type> entries, just like <property> does:

Code:
        <set name="roles">
            <key column="USER_ID"/>
            <element>
                <column name="ROLE_ID"/>
                <type name="PersistableEnumType">
                    <parameter name="enum">my.pkg.Role</parameter>
                </type>
            </element>
        </set>


Thanks,
Mihai


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.