开发者

what is the difference between hibernate 2.X and hibernate 3.0

can anybody ex开发者_开发技巧plain me exact difference between hibernate 2.X and hibernate 3.0 i could not figure out the same

Thanks


Typically version increases include more features and bug fixes. Here is the hibernate 2->3 migration guide, which should give you an idea.

http://community.jboss.org/wiki/HibernateCoreMigrationGuide30

You'll see that they did things like make all exceptions unchecked, added some methods in places, deprecated some methods in places, and so on.


Some of Key Points Hibernate 2.x V Hibernate 3.x:

Hibernet2.x version increases to Hibernet3.x, that is include more features and bug fixes. Hibernate 3.0 is not source-compatible with Hibernate 2.1. The changes made in Hibernet3.0 were carefully designed to allow straightforward migration of both code and metadata. It is possible to run Hibernate 2.x and Hibernate 3.x side by side in the same application.
Some of Changes made in Hibernate3.x compared with Hibernet2.x:

API Changes:

The Hibernate3 package structure is rooted at org.hibernate
instead of net.sf.hibernate.This renaming was done to allow Hibernate2 and Hibernate3 to run side by side in the same application. Certain interfaces that have been deprecated in Hibernate3 were moved to the org.hibernate.classic package. HibernateException and all other Hibernate exceptions are changed in Hibernate3 as a unchecked runtime exceptions. Compared to Hibernate2 , Hibernate3 provides the ParameterizedType interface to allow better re-useability of user type implementations. Hibernate3.x wraps Blob and Clob instances, to allow classes with a property of type Blob or Clob to be detached,serialized, deserialized, and passed to merge(). Hibernate2.x not supported this feature. Metadata Changes :

In Hibernate2.x it is best practice to map almost all classes and collections using lazy="true",that is in Hibernate3.x the default feature. In hibernate2.x applications will need to explicitly specify lazy="false" on all non-lazy class and collection mappings. In hibernet 3.x The outer-join attribute is deprecated.Use fetch="join" and fetch="select" instead of outer-join="true" and outer-join="false". The element is semi-deprecated, and are now preferred In hibernate3.x. is preferred to .
is preferred to . DTD reference in hbm XML files is changed in Hibernate 3.x when compared to Hibernate2.x.

Query Language Changes :

Hibernate3 comes with a brand-new, ANTLR-based
HQL/SQL query translator. However, the Hibernate 2.1 query
parser is still available. The query parser may be selected by setting the Hibernate
property hibernate.query.factory_class.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜