-->
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: Mapping enum in JPA/Hibernate
PostPosted: Mon Aug 24, 2009 9:02 pm 
Beginner
Beginner

Joined: Sat Dec 03, 2005 11:12 am
Posts: 27
Hi,

I have an Enum StatusType

[code]# public enum StatusType
# {
# PENDING, APPROVED
# } [/code]

In my entity class i am mapping as

# @Enumerated(EnumType.STRING)
# @Column(name ="status", nullable = false, length = 20)
# public StatusType getStatus() {
# return this.status;
# }
#
# public void setStatus(StatusType status) {
# this.status = status;
# }

I have no problem saving the enum value but when i try to retrieve the entity i get status as null.

Can anyone point me where am i going wrong?

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.