This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes [Hibernate] Should I use enum to mapping the column? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "[Hibernate] Should I use enum to mapping the column?" Watch "[Hibernate] Should I use enum to mapping the column?" New topic
Author

[Hibernate] Should I use enum to mapping the column?

avseq anthoy
Ranch Hand

Joined: Apr 27, 2004
Posts: 104
Dear all

I have a table as below


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~


My Way,My Pace
 
Consider Paul's rocket mass heater.
 
subject: [Hibernate] Should I use enum to mapping the column?
 
Similar Threads
JPA Annotation @Column + column defination
How to use a Timestamp as the Identifier
Hibernate Inheritance Mapping Question !
Registering IN OUT parameter
hibernate mapping files for enumerated strings.