|
From: Colin S. <col...@ex...> - 2005-03-23 15:10:28
|
Alexandru Popescu wrote: >Hi! > >I saw in the ML that the Hibernate3 support is in CVS HEAD already. Can you point me to the main >changes provided in the Spring support for Hibernate3 vs Hibernate2? (i expected there where changes >required by the changes (from check to unchecked) exceptions in Hibernate3 and for supporting the >new features, but it will be more easy for me to have a Spring expert opinion on this). > > Alex, Juergen did the actual conversion, so is the final authority, but the port is mostly a straight port of the existing classes to reflect the new packages used by Hibernate 3. One difference in Hibernate 3 is that Hibernate 3 does throw unchecked exceptions instead of checked exceptions, but Spring users should actually be insulated from that, as they would have normally be catching Spring's own unchcked DataAccessExceptionHierarchy. Spring's HibernateTemplate class for Hibernate v3 does add the important methods added to v3's Session, such as the 'load()' variants which take an entityName, e.g.: http://www.hibernate.org/hib_docs/v3/api/ Generally, you should be able to take existing Spring-based code using the Hibernate 2 support, and convert it to using the Hibernate 3 support, by just changing all org.springframework.hibernate.* package names to org.springframework.hibernate3.*. Any breakage (not that you should generally expect any) should generally be from changes in Hibernate itself between versions, and not the Spring support code. Note that Hibernate has actually deprecated a few methods on the Session interface (they are only available now as part of the org.hibernate.classic.Session interface. I believe HibernateTemplate has also removed some of the methods which were directly exposed and are now deprecated. Colin |