-->
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.  [ 2 posts ] 
Author Message
 Post subject: Should I use enum to mapping the column?
PostPosted: Wed May 25, 2011 9:12 pm 
Newbie

Joined: Tue Aug 29, 2006 2:54 am
Posts: 16
Dear all

I have a table as below
Code:
SEQ_NO      VARCHAR2(10) PK
ORDER_NO   VARCHAR2(10)
BILL_TYPE   VARCHAR2(1)


For the Bill_TYPE column , the value 0、1 and 2 represent different bill type.
Should I use an enum for the column mapping or only use the normal java String for the column mapping?

I think the java string for the column mapping is simpler than enum mapping in the application.
But use enum can avoid assign wrong type value in the code.

Can someone give me other suggestions?
thanks~


Top
 Profile  
 
 Post subject: Re: Should I use enum to mapping the column?
PostPosted: Sat May 28, 2011 11:39 pm 
Newbie

Joined: Wed Jun 24, 2009 9:10 pm
Posts: 10
Enums are more appropriate than Strings here.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

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.