-->
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: MySQL Enums
PostPosted: Tue Dec 27, 2005 12:56 pm 
Beginner
Beginner

Joined: Thu Jul 21, 2005 10:28 am
Posts: 21
Hibernate version: 3.1

Mapping documents:
<!-- `has_price_flag` enum('Y','N') NOT NULL default 'N', -->
<property name="hasPriceFlag"
column="has_price_flag" type="rating" not-null="true"
update="false" access="field"/>

Name and version of the database you are using:
mySQL 4.0.2
<!-- `has_price_flag` enum('Y','N') NOT NULL default 'N', -->

I did read through the documentation, and I found this link:
http://www.hibernate.org/272.html
But this link seems to be for persisting a JDK 1.5 Enum class to the database.

I was also reading through the Professional Hibernate book and the HIA book, and it seems both these books don't cover 3.x version of Hibernate. I also looked through the forums, and I didn't see anything that would answer my question.

My real problem is that I am trying to take an existing database, that has a table with multiple enums in it. One field is as follows:
`has_price_flag` enum('Y','N') NOT NULL default 'N',

So, I want to map this in my hbm.xml file, and I need to know how I setup my VO class, and any other classes I might need. In the case of this one field: I have this class:

package com.mypackage.dataAccess.dvo;
public enum HasPriceFlag {Y, N;}

Any help with this would be much appreciated! Thanks!


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.