-->
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: Set of Enum using typedef
PostPosted: Tue Dec 04, 2012 10:54 am 
Newbie

Joined: Wed Nov 28, 2012 6:16 am
Posts: 4
Hi, I'm trying to save a set of enum using this example: http://stackoverflow.com/questions/2402869/hibernate-how-to-map-an-enumset

but this Exception appears: Caused by: org.xml.sax.SAXParseException element type "type" must be declared

hbm.xml:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping
    PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>   
           
    <typedef name="permission" class="GenericEnumUserType">   
        <param name="enumClassName">Permissions</param>
    </typedef>
   
       
    <class name="UserDetailsDao">       
       
        <id name="id">
            <generator class="increment"/>
        </id>
       
        <property name="password" type="string"/>
        <property name="name" type="string"/>
       
        <set name="permissions">
            <key column="id"/>
            <element type="permission"/>
        </set>
       
    </class>
</hibernate-mapping>


cfg.xml:

Code:
...
<mapping resource="UserDetailsDao.hbm.xml"/>
...


What is the problem here?


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.