I have realized I am missing something obvious. Not sure what it is, Hoping somene an help me see what I am not seeing.
My company starts with mapping files and generates schema and java files.
I am trying to figure out how to map. I have a table with a column that can have only 1 on a limited number of strings:
‘DOES_NOT_EXIST’, ‘NEW,INITIATILIZE’, ‘RUNNING’, ‘TEARDOWN’
TABLE STATE_MACHINE
....
STATE VARCHAR2(32)
.....
public enum StatEnum {
DOES_NOT_EXIST, NEW,INITIATILIZE, RUNNING, TEARDOWN
}
what we want to do is something along the lines of
StateMachine machine = new StateMechine();
machine.state=StatEnum.NEW;
....
Persistance.save(machine)
Problems is I am receiving “Can’t commit transaction: Could not execute JDBC batch update: ORA-00932: inconsistent datatypes: expected BINARY got NUMBER”
I think the HBM mapping file should be something along the lines of
com.foo.StateEnum
12
Can some point me at some documentation that does what I am trying to do.
Thanks for helping me to learn…
I ended up creating a class that implements EnhancedUserType and ParameterizedType.
In the package that Implements the above classes I placed my enum class.
my Hibernate xml has