Hibernate version: 2.1.7
I read Hibernate in Action, it introduced us a new way to implement safe enumeration. but I still can't understand how to implement the logic to set value to my UserType entity.
for exemple,
A enumeration,
Code:
public class MyType implements Serializable {
...
}
A UserType implementation,
Code:
public class MyUserType implements UserType {
...
public Class returnedClass() { return MyType.class; };
...
}
A Entity,
Code:
public class MyEntity {
...
private Long id;
private MyUserType myUserType;
...
}
As the example, how do I set the value to myUserType property in MyEntity?
What I means is that MyUserType is not an enumeration, how do I reflect the value user wanted to myUserType?