I have a table with a column type as TimeStamp in Mssql and generated pojos using hibernate(reverse engineering).In the generated Pojo,timestamp field is marked as byte[].
In the debugging process,I found TimeStamp sqlType code is "-2" that is Binary Type in Hibernate types and Hibernate binary type is equivalent to byte[] in java.
Java, hibernate and sql server for timestamp data type
Mssql Hibernate Java Type
----- --------- ---------
Timestamp Binary byte[]
I dont understand why only mssql type TimeStamp is mapped with Binary in Hibernate.But in other databases like Postgres,oracle,mysql...timestamp is mapped to hibernate timestamp type.
I can resolve this issue by adding type-mapping in hibernate.reveng.xml by mapping sql timestamp to hibernate timestamp. Dont know what else issues occurs further.