List of migration concerns as users migrate from 3.3 to 3.5:
- Hibernate properties configured as
type="text"
now map to JDBC LONGVARCHAR; in pre-3.5 versions,text
properties were mapped to JDBC CLOB. A new Hibernate type,materialized_clob
, was added to map Java String properties to JDBC CLOB. If an application has properties configured as
type="text"
that are intended to be mapped to JDBC CLOB, then they should be changed totype="materialized_clob"
in hbm mapping files, or, if using annotations,@Type(type = "text")
should be replaced by@Lob
. - Numeric aggregate
Criteria
projections now return the same value type as their HQL counterparts. As a result, the return type from the following projections inorg.hibernate.criterion
have changed:- "count" and "count distinct" projections now return a
Long
value (due to changes inCountProjection
,Projections.rowCount()
,Projections.count( propertyName )
, andProjections.countDistinct( propertyName )
). - "sum" projections return a value type that depends on the property type due to changes in
Projections.sum( propertyName ):
- for properties mapped as
Long
,Short
,Integer,
or primitive integer types, aLong
value is returned; - for properties mapped as
Float
,Double
, or primitive floating point types, aDouble
value is returned.
Failing to adapt application code to these changes will cause: java.lang.ClassCastException - for properties mapped as
- "count" and "count distinct" projections now return a
Comments