Suppose I have an object like
public class Handle {
private String handle;
public Handle(String name) {
this.handle=name;
}
public String toString() {
return this.handle;
}
}
that is a property of some POJO that I would like to persist with Hibernate. How do I define the mapping for my POJO such that its Handle object is just stored as a string?
Clarification: What I was really asking here is, how do I persist custom types? The answer is to implement a UserType.