What's New In Hibernate 4.0 release
In this tutorial you will learn about the new features introduced in Hibernate core 4.0
Hibernate core 4.0.0 was finally released in the year 2011 in the month of Dec. New features that are introduced in Hibernate core 4.0 releases are as follows :
- Provide support for initial multi-tenancy.
- Introduces a ServiceRegistry.
- Clean up of Session opening from SessionFactory.
- Using org.hibernate.integrator.spi.Integrator made integration and auto discovery more desirable.
- Improve to work with i18n and message codes.
- Clean up of deprecated interfaces, methods, etc.
Major changes made in Hibernate core 4.0 release is the introduction of ServiceRegistery to provide how to access the registered services. And in this release some methods classes and interfaces have been deprecated. Here I am giving some list of them.
Methods that have been deprecated and removed from are as follows :
Following deprecated methods are references to org.hibernate.type.AbstractSingleColumnStandardBasicType :
- get(ResultSet rs, String name) use get(ResultSet rs, String name, SessionImplementor session)
- nullSafeGet(ResultSet rs, String name) use nullSafeGet(ResultSet rs, String name, SessionImplementor session) instead.
- nullSafeSet(PreparedStatement st, T value, int index) use nullSafeSet(PreparedStatement st, Object value, int index, SessionImplementor session) instead.
- set(PreparedStatement st, T value, int index) use set(PreparedStatement st, T value, int index, SessionImplementor session)
Following deprecated methods are references to org.hibernate.usertype.UserType :
- nullSafeGet(ResultSet rs, String[] names, Object owner) use nullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) instead.
- nullSafeSet(PreparedStatement st, Object value, int index) use nullSafeSet(PreparedStatement st, Object value, int index, SessionImplementor session) instead.
- Session.reconnect().
- Session.connection() use following methods according to requirement Session.doWork(), Session.doReturningWork() or Session.sessionWithOptions(), Session.openSession() instead
Classes/Interfaces that have been deprecated are as follows :
- org.hibernate.classic.Session
- org.hibernate.classic.Validatable etc.