I currently have a Java object that I am using HBM XML file to map to. The Java datatype of the property "year" is String, while the postgres column it corresponds to is of type smallint. I would like to map it to each other in my HBM XML, but am facing issues.
<property name="year" type="string">
<column name="year" sql-type="short" />
</property>
This is what I was expecting to work, but I am getting an error when persisting a record into this table that says:
SqlExceptionHelper ERROR: column "year" is of type smallint but expression is of type character varying
I have also tried putting "smallint" in sql-type, but with same error.