What does Hibernate map a boolean datatype to when using an Oracle database by default?

As @Arthur said it maps to Number(1) which would be the standard sql bit where 0 == false and 1 == true. As an alternative you can map char(1) to ‘T’ or ‘F’ like this

@org.hibernate.annotations.Type(type="true_false")
@NotNull
boolean myBoolean;

or map it to ‘Y’ or ‘N’

@org.hibernate.annotations.Type(type="yes_no")
@NotNull
boolean myBoolean;

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)