Hibernate 4.3.0.Final 发布,Java中最流行的持久层框架

jopen 10年前

Hibernate是一种Java语言下的对象关系映射解决方案。 它是使用GNU宽通用公共许可证发行的自由、开源的软件。它为面向对象的领域模型到传统的关系型数据库的映射,提供了一个使用方便的框架。Hibernate也是目前Java开发中最为流行的数据库持久层框架,现已归JBOSS所有。

它的设计目标是将软件开发人员从大量相同的数据持久层相关编程工作中解放出来。无论是从设计草案还是从一个遗留数据库开始,开发人员都可以采用Hibernate。

Hibernate不仅负责从Java类到数据库表的映射(还包括从Java数据类型到SQL数据类型的映射),还提供了面向对象的数据查询检索机制,从而极大地缩短的手动处理SQL和JDBC上的开发时间。

今天Hibernate 团队宣布 Hibernate ORM 4.3.0 Final 版本发布,该版本通过了 JPA 2.1 规范认证。

JPA 2.1 包含如下新特性:

  • Support for stored procedures. See my previous blog for details
  • CriteriaUpdate and CriteriaDelete allow definition and execution of UPDATE and DELETE queries in type-safe Criteria form.
  • Entity listeners can now take advantage of dependency injection through CDI.
  • AttributeConverters, which define the ability to apply conversions on basic values between their database representation and their representation in your domain model. This is similar in concept to Hibernate's Type contract, although certainly less powerful (can only apply to basic values and operate on in-memory values). On the positive side, JPA AttributeConverters are portable across providers.
  • Entity Graph support
  • Standardized schema generation. With 2.1 JPA now defines schema generation which is standardized across providers in terms of how generation is performed and the settings providers understand as a baseline. Arun Gupta has a good write up of the basic schema generation support.
  • Synchronization of persistence contexts via SynchronizationType
  • @ConstructorResult support in result set mappings for native queries

非 JPA 方面的工作还包括:

  • Continued improvement in Hibernate's support for OSGi environments. OSGi support in 4.3 is still somewhat bound by certain design limitations within Hibernate, We plan to fully address these limitations in 5.0 (see HHH-8501 for details).
  • Continued work on new bytecode enhancement support within Hibernate, adding support for inline dirty checking. See HHH-8354 for details.
  • Initial break down of the monolithic DocBook-based manuals into smaller Asciidoc-based topical guides (HHH-8606). This is an ongoing process.