What's new in Hibernate ORM 5?

Shri S Softwares picture Shri S Softwares · Aug 12, 2015 · Viewed 35k times · Source

I just saw that the 4th candidate got released for Hibernate 5. What's new in 5 compared to earlier versions?

Answer

Bacteria picture Bacteria · Aug 12, 2015

Some exciting features has been added/enhanced in Hibernate 5.x. Have a quick look.

1. Hibernate Search

Hibernate Search transparently indexes your objects and offers fast regular, full-text and geolocation search. Ease of use and easy clustering are core.

  • Full-text search for entities - find by approximation (fuzzy search)
  • Cluster-friendly - offers several easy to setup clustering strategies
  • Faceting and geolocation - Geolocalized entities are as easy as @Spatial

For more details on Hibernate Search view this.

2. Hibernate Validator

Hibernate Validator comes with a handful of built-in validation rules like Email, Length, NotBlank etc.

Express validation rules in a standardized way using annotation-based constraints and benefit from transparent integration with a wide variety of frameworks.

For more details on Hibernate Validator view this.

3. Improved Java 8 Support

Java 8 date/time data types (JSR 310) are supported and can be validated via @Past and @Future. Also Optional and JavaFX types are supported via an improved ValidatedValueUnwrapper.

4. Hibernate OGM

Just released the first stable version.

5. Bootstrapping API

New bootstrapping API - better determinism, better integration


A few other things:

  • Scanning support for non-JPA usage
  • NamingStrategy has been removed in favor of a better designed API
  • Ability to handle additional Java types for id attributes marked as GenerationType#AUTO. Built-in support for Number and UUID. Expandable via new org.hibernate.boot.model.IdGeneratorStrategyInterpreter extension.
  • Additionally, support for AttributeConverters has been expanded and more fully realized

Check Hibernate ORM Roadmap for more details.