This guide discusses migration from Hibernate ORM version 5.0 to version 5.1. For migration from earlier versions, see any other pertinent migration guides as well.
Previous versions of Hibernate have mapped
Byte to Oracle’s
LONG RAW data type (via the JDBC
LONGVARBINARY type). Oracle have deprecated the
LONG RAW data type for many releases - possibly as far back
as 8i. Therefore it was decided to start having Hibernate map
BLOB for Oracle.
However, in the interest of backwards compatibility and not breaking existing applications it was also decided to
limit this change to just the Oracle12cDialect. So starting in 5.1 applications using Oracle12cDialect and
Byte values will start seeing those handled as
BLOB data rather than
data. For existing applications that want to continue to use Oracle12cDialect and still continue to implicitly map
Byte attributes to
LONG RAW, there is a new configuration setting you can use to enable that:
hibernate.dialect.oracle.prefer_longvarbinary, which is false by default (map to
The changes mainly focused on:
Unifying handling of
hbm2ddl.autoand Hibernate’s JPA schema-generation support.
Removing JDBC concerns from the SPI to facilitate true replacement (for OGM)
These changes will only be a migration concern for applications directly using any of the following classes:
org.hibernate.tool.schema.spi.SchemaManagementToolor any of its delegates