开发者

Hibernate - beyond Object/Relational Mapping?

Looking at http://www.hibernate.org/ it has this introduction text:

Historically, Hibernate facilitated the storage and retrieval of Java domain objects via Object/Relational Mapping. Today, Hibernate is a collection of related projects enabling developers to utilize POJO-style domain models in thei开发者_开发问答r applications in ways extending well beyond Object/Relational Mapping.

In other words: originally it was about ORM, now it's about more than ORM.

Reading between the lines: ORM isn't the only game in town - there are newer ways of approaching these things that may work better.

When I go into the documentation, it still just describes it as an ORM library. Are there any good blog posts that give an overview of specifically any new "post-ORM" approaches that have been taken, and how those features work and are intended to be used (and how/why they might be better than "traditional" ORM)?


It depends how you define and what you expect form an ORM tool. I think of ORM of a something that just does, er, object to db mapping and vice versa. Hibernate does a lot more, for example:

  • caching (objects/queries, first/second level)
  • lazy loading
  • ability to replicate object between two different datastores
  • declarative security
  • Criteria API
  • mapping between objects and XML
  • automatic schema generation

The list can probably go on an on (if you're not convinced yet, add Spring integration on top). If one would be asked yourself ten years ago, none would name these features being be part of a casual ORM library.

We are so used to Hibernate now that people stopped noticing it become a feature creep very rich framework. Obviously most of those features come with a price, but you can always choose not to pay and stick with basic ORM.


Reading between the lines: ORM isn't the only game in town - there are newer ways of approaching these things that may work better.

Reading literally: they talk about "related projects" that provide additional features, namely:

  • Hibernate Validator - declarative validation of POJOs
  • Envers - transparent auditing and versioning
  • Hibernate Search - full text search integration
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜