Okay. That makes sense to me now. I think the main reason this has been so confusing is because the types of the individual properties of my returnedClass() aren't both basic hibernate types. Now I'm a bit confused as to how to implement getPropertyValue() and setPropertyValue().
I'm trying to create a CompositeUserType that handles the persistence of the following class:
Code:
public class CommandParameterData implements Serializable {
private CommandParameterDataTypeEnum type = null;
private Object data = null;
public CommandParameterDataTypeEnum getType() {
return type
}
public void setType(CommandParameterDataTypeEnum type) {
this.type = type;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
}
The getType() method on this class returns an Enum class (which serializes to an integer). My CompositeUserType stuff seems fairly straight forward except for the getPropertyValue() and setPropertyValue() implementations. For the Type property, should I return an integer or the Enum value? Right now I'm returning the type Hibernate.INTEGER for that column, is that correct or do I need yet another UserType implementation for this?
I have a similar issue with my getData() property also. I'm storing it as a string in the database.
What are setPropertyValue() and getPropertyValue() used for?
Thanks
Phill