I have enum ClientType{INTERNAL,ADMIN}, i am able to persist enum with hibernate annotations.
but inserted value is INTERNAL,ADMIN. How can i define my own vlaue. I want table to contain “I” for INTERNAL.
How can i do this hibernate annotations.
I have enum ClientType{INTERNAL,ADMIN}, i am able to persist enum with hibernate annotations. but
Share
There is no support for this built into Hibernate/JPA that I’m aware of. The best way to do this is to have a
charproperty in your entity containing either ‘I’ or ‘A’, but to only expose theClientTypeenum: