How to match CHAR (1) with a boolean using Hibernate for Java?

How to match CHAR (1) with a boolean using Hibernate for Java?

+6
java hibernate
source share
2 answers

Types true_false or yes_no will do this for you.

+2
source share

CharBooleanType is probably what you are looking for http://www.hibernate.org/hib_docs/v3/api/org/hibernate/type/class-use/CharBooleanType.html

edit: dtsazza's answer is probably more useful if you just want to go over and use the y / n or t / f characters. If they do not match your usage, you can implement your own type using CharBooleanType.

+2
source share

All Articles