I'm trying to map a tinyint(1) column in Hibernate. For requirements, I need to save value "2" in the column but I can't change the sql type of it. If I declare it as an Integer in my class the hibernate validation fail. How can I get validation working and having the column int or byte to save value 2 in it?
this is my code:
<property name="flag" type="java.lang.Integer">
<column name="flag" not-null="true" sql-type="TINYINT"/>
</property>
I need to save value 2 into flag column