Hi,
I've reviewed several other posts, and apologise if this (repeated) issue grates folks, but can't understand why my annotations aren't persisting my enum as its string representation; instead, it's persisting it as a serialized object (it seems).
The enum:
Code:
public enum CommentSource{
MAIL,
EMAIL,
PHONE,
WEB;
The class:
Code:
@Entity
public class Comment {
@Enumerated(EnumType.STRING)
private CommentSource source;
public void setSource(CommentSource s){
this.source = s;
}
public CommentSource getSource(){
return this.source;
}
I would expect my implementing class to persist "EMAIL" when going:
Code:
myPojo.setCommentSource(CommentSource.EMAIL);
My HBM file simply contains:
Code:
<property name="source" column="COMMENT_SOURCE" type="entity.CommentSource"/>
I'm using 3.6.3 and mySQL 5.5.
Thanks in advance