Hi foggy,
I just have read
https://hibernate.onjira.com/browse/HHH-7060 and
https://hibernate.onjira.com/browse/HHH-6815today, and according what's written there, the problem is solved if you use Hibernate version 4:
if you use Hibernate version 4 then Java byte should be mapped to smallint.
Alternatively if you don't cant switch to hibernate4, you can also write and use a custom SQLServerDialect like following:
Code:
public class MyCustomSQLServerDialect extends SQLServer2008Dialect {
@Override
protected SqlTypeDescriptor getSqlTypeDescriptorOverride( int sqlCode ) {
return sqlCode == Types.TINYINT ? SmallIntTypeDescriptor.INSTANCE : super.getSqlTypeDescriptorOverride(sqlCode);
}
}
If you bootstrap the database with MyCustomSQLServerDialect then the byte-type properties should be mapped as smallint types.