Hibernate features

In this section, you will get to know about newly added feature in Hibernate 4 and the existed feature in Hibernate.


 

Ads

Tutorials   
How to write hello world example program in Hibernate? How to create one to one relationship in Hibernate 4 with Annotation? How to calculate minimum in Hibernate using the min() Function Hibernate 4.3.4 Released: Hibernate 4.3.4.Final Maven dependency Hibernate 4.3 Hello World: Example How to create SessionFactory in Hibernate 4.3.1? Hibernate 4 Hello World: Example of Hello World program Hibernate 4 create Session Factory: Example of creating Session Factory in Hibernate 4 Hibernate 4.3 and JPA 2.1 Example What is Hibernate in Java? Hibernate Overview and Architecture What is JPA 2.1? Hibernate 4.3.0.Final Maven dependency Hibernate 4.3 ORM Features Hibernate 4.3 Tutorial Hibernate Criteria average example Hibernate Criteria load all objects from table Hibernate Criteria Hibernate beginner tutorial Hibernate Session.delete() Example Hibernate save or update method example Hibernate Load Example Hibernate save Example - Rose India Hibernate 4 tutorials Hibernate Example Step by Step in Eclipse Hibernate Configuration files Setup Hibernate Environment Hibernate Architecture Hibernate Overview Hibernate 4.2 Tutorial Hibernate 4 Annotations Tutorial Hibernate 4 AnnotationSessionFactoryBean hibernate versions hibernate jndi hibernate tomcat hibernate metamodel generator hibernate entity Seam Hibernate C3P0 Hibernate hibernate shard hibernate means temporal hibernate jsf hibernate spring j2ee hibernate spring hibernate encrypted password alias_to_entity_map hibernate temporal jsf spring hibernate hibernate by example hibernate repository hibernate sample code
Ads

Hibernate features

In this section, you will get to know about newly added feature in Hibernate 4 and the existed  feature in Hibernate.

Newly added feature in Hibernate 4

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.

Features of Hibernate

Transparent persistence without byte code processing

  • JavaBeans style properties are persisted
  • No build-time source or byte code generation / processing
  • Support for extensive subset of Java collections API
  • Collection instance management
  • Extensible type system
  • Constraint transparency
  • Automatic Dirty Checking
  • Detached object support

Object-oriented query language

  • Powerful object-oriented query language
  • Full support for polymorphic queries
  • New Criteria queries
  • Native SQL queries

Object / Relational mappings

  • Multiple-objects to single-row mapping
  • Polymorphic associations
  • Bidirectional associations
  • Association filtering
  • Collections of basic types
  • Indexed collections
  • Composite Collection Elements
  • Lifecycle objects

Automatic primary key generation

  • Multiple synthetic key generation strategies
  • Support for application assigned identifiers
  • Support for composite keys

Object/Relational mapping definition

  • XML mapping documents
  • Human-readable format
  • XDoclet support

HDLCA (Hibernate Dual-Layer Cache Architecture)

  • Thread safeness
  • Non-blocking data access
  • Session level cache
  • Optional second-level cache
  • Optional query cache
  • Works well with others

High performance

  • Lazy initialization
  • Outer join fetching
  • Batch fetching
  • Support for optimistic locking with versioning/timestamping
  • Highly scalable architecture
  • High performance
  • No "special" database tables
  • SQL generated at system initialization time
    (Optional)
  • Internal connection pooling and PreparedStatement caching

J2EE integration

  • JMX support
  • Integration with J2EE architecture (optional)
  • New JCA support

Advertisements

Ads
Share on Google+Share on Google+

Hibernate features

Posted on: April 16, 2012 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Advertisements

Ads
 

Discuss: Hibernate features  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0

Ads

 

Ads