-->
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: JPA mapping for enums
PostPosted: Mon Feb 09, 2009 11:56 am 
Newbie

Joined: Mon Feb 09, 2009 11:52 am
Posts: 11
I have a enum that is stored in a DB. I didn't design the DB so the value is a char and I need to convert it to the Enum value. So I created a class that look like the following(FYI I am using groovy)


Code:
public enum MatchingMethod {
    I_STATE("I")
    private Character dbValue;
    public MatchingMethod(Character dvValue){
        this.dbValue = dbValue
    }
}


Now I want to map it using annotations anyone have an idea how I would do this?

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.