correct, that is more or less what I have.
public enum A{
STATE1 value "A",
STATE2 value "B",
STATE3 value "C"
}
I've added this pseudo code to indicate the values of my enum (the name)
I want these values (A, B, C) to be found in the database (the name value of the enums)
Hibernate creates the database itself (through annotations) and makes a column in oracle of type RAW.
In this column I can find my enumtype object (is this what they mean with enum ordinal ?) ... instead of the string "A", "B" or "C" that I expect to see.
I need this string value to allow my end-users to query on the database without having any knowledge on the inner workings of the program.
I've tried to change the column type to NVARCHAR(255) but that didn't get me anywhere either. Just gave me data-truncations (304 -> 255 lenght).
Hope this helps ?
Main Topics
Browse All Topics





by: dejanpazinPosted on 2007-06-19 at 07:51:55ID: 19316344
So, if I understend correctly, you have something like this:
public enum A{
STATE1,
STATE2,
STATE3
}
@Entity
public class B{
private A state;
@Enumerated(EnumType.STRIN
public A getState() {
return state;
}
public void setState(A state){
this.state = state;
}
}
If this is it, then can you please describe more about what exactly is wrong.