-->
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: Enum mapping in .hbm.xml file
PostPosted: Sun Mar 30, 2008 1:41 pm 
Newbie

Joined: Sun Mar 30, 2008 1:37 pm
Posts: 5
I have the field status in one of my classes

It has enum type:

public enum Status {
OPENED,
CLOSED;
}


I map it this way
<property name="status" not-null="true">
<type name="org.hibernate.type.EnumType">
<param name="enumClass">com.javaxshop.domain.manager.pojo.ShopOrderStatus</param>
<param name="sqlType">12</param>
</type>
</property>


Hibernate generates it this way
status integer not null

But I want to has string type in my db for enum type.
How I can get it?


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.