Issue Type: Bug Bug
Affects Versions: 4.1.10, 4.1.9, 4.1.8, 4.1.7
Assignee: Unassigned
Components: core
Created: 12/Mar/13 11:31 AM
Description:

Enumeration properties with the @Enumerated(EnumType.STRING) on the getter will still be treated as ordinal and throw SQL exceptions when loading if there are any fields with annotations in the same entity.

This can be worked around by not mixing field and getter annotations.

Example:

create table MyEntity (
id integer auto_increment,
value enum('A', 'B')
);

enum MyEnum { A, B };

@Entity
class MyEntity {
@Id private int id;
private MyEnum value;

public int getId() { return this.id; }
public void setId(int id) { this.id = id; }

@Enumerated(EnumType.STRING)
public MyEnum getValue() { return this.value; }
public void setValue(MyEnum value) { this.value = value; }
}

Project: Hibernate ORM
Priority: Minor Minor
Reporter: Michael Bond
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira