-->
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: Genreate enum column type
PostPosted: Tue Jul 30, 2013 9:59 pm 
Newbie

Joined: Wed Feb 27, 2013 2:59 pm
Posts: 6
Hi, I am using a enum type in postgres.
When automatically generating the schema, how can I get the column on the table to have the right type = the enum type.
Also have can I create the enum in the database before the ddl is executed ?
When I create the schema the column is a character

Quote:
property name="hibernate.hbm2ddl.auto" value="create-drop" />


Quote:
CREATE TYPE option AS ENUM (
'art_delivery',
'binding_side');



Code:
@Enumerated(EnumType.STRING)
@Column(name = "option_type", nullable = false)
private Option optionType;


Code:
public enum Option {
   ART_DELIVERY("art_delivery"),
   BINDING_SIDE("binding_side");


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.