Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: MappingException bei enums
PostPosted: Thu Mar 29, 2012 9:29 am 
Newbie

Joined: Mon Feb 13, 2012 4:59 am
Posts: 8
Hallo,

ich hab eine Klasse, welche als Attribut ein enum hat.
Das enum steht in meiner Klasse UserUtil und heisst UserRole.
Das Attribut in der abzuspeichernden Klasse ist private UserUtil.UserRole role.

Das Hibernate Tool hat mir daraufhin meine Mapping-Datei soweit verändert:
Code:
        <property name="role">
            <column name="ROLE" />
            <type name="org.hibernate.type.EnumType">
                <param name="type">12</param>
                <param name="enumClass">com.maps.client.UserUtil$UserRole</param>
            </type>
        </property>



Jetzt erscheint beim Ausführen dann der Fehler:

Code:
org.hibernate.MappingException: Could not determine type for: org.hibernate.type.EnumType, at table: SIMPLEUSER, for columns: [org.hibernate.mapping.Column(ROLE)]
   at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:292)
   at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:276)
   at org.hibernate.mapping.Property.isValid(Property.java:207)
   at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:458)
   at org.hibernate.mapping.RootClass.validate(RootClass.java:215)
   at org.hibernate.cfg.Configuration.validate(Configuration.java:1135)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1320)


Weiss jemand, was ich machen muss?

Ich verwende hibernate 3.6.9.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 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.