This guide discusses migration from Hibernate ORM version 4.3 to version 5.0. For migration from
earlier versions, see any other pertinent migration guides as well.
== Re-purposing of Configuration
Configuration, historically, allowed users to iteratively add settings and mappings in any order and to query the
state of settings and mapping information in the middle of that process. Which meant that building the mapping
information could not effectively rely on any settings being available. This lead to many limitations and problems.
Quite a few methods have been removed from Configuration. Be sure to see the User Guide chapter on bootstrapping for
details. For applications that integrate with Hibernate via one or more APIs, this change might effect your
integrations as well.
== Short-naming
In an effort to insulate applications from refactoring efforts, Hibernate has begun to recognize "short name" values for
certain configuration settings. These are discussed in detail in the User Guide in the pertinent sections.
Where available, we highly recommend using the short name for a setting value.
== Transactions
The transaction SPI underwent a major redesign as part of 5.0 as well. From a user perspective this generally
only comes into view in terms of configuration. Previously applications would work with the different backend
transaction stratagies directly via the `org.hibernate.Transaction` API. In 5.0 a level of indirection has been
added here. The API implementation of `org.hibernate.Transaction` is always the same now. On the backend, the
`org.hibernate.Transaction` impl talks to a `org.hibernate.resource.transaction.TransactionCoordinator` which represents
the "transactional context" for a given Session according to the backend transaction strategy. Users generally do not
need to care about the distinction.
The change is noted here because it might affect your bootstrap configuration. Whereas previously applications would
specify `hibernate.transaction.factory_class` and refer to a `org.hibernate.engine.transaction.spi.TransactionFactory` FQN,
with 5.0 the new contract is `org.hibernate.resource.transaction.TransactionCoordinatorBuilder` and is specified using the
`hibernate.transaction.coordinator_class` setting. See `org.hibernate.cfg.AvailableSettings.TRANSACTION_COORDINATOR_STRATEGY`
JavaDocs for additional details.
The following short-names are recognized:
`jdbc`::(the default) says to use JDBC-based transactions (`org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl`)
`jta`::says to use JTA-based transactions (`org.hibernate.resource.transaction.backend.jta.internal.JtaTransactionCoordinatorImpl`)
See the User Guide for additional details.
== Type handling
* Migrated `org.hibernate.metamodel.spi.TypeContributor` and `org.hibernate.metamodel.spi.TypeContributions`
to `org.hibernate.boot.model.TypeContributor` and `org.hibernate.boot.model.TypeContributions`
* Built-in `org.hibernate.type.descriptor.sql.SqlTypeDescriptor` implementations no longer auto-register themselves
with `org.hibernate.type.descriptor.sql.SqlTypeDescriptorRegistry`. Applications using custom SqlTypeDescriptor
implementations extending the built-in ones and relying on that behavior should be updated to call