Spring FrameworkDAO support

Traducteur:  
(Dernière date de traduction:  )
Relecteur:  
(Dernière date de relecture:  )
Index des chapitres

Légende:
       à revoir
       non compris
       à faire
       non traduit ( laissé tel quel )

chapter
+ titleRef.   /chapter[1]/title[1]
OriginalTraduction
DAO support  
sect1
+ titleRef.   /chapter[1]/sect1[1]/title[1]
OriginalTraduction
Introduction  
+ paraRef.   /chapter[1]/sect1[1]/para[1]
OriginalTraduction
The DAO (Data Access Object) support in Spring is primarily aimed at making it easy to work with data access technologies like JDBC, Hibernate or JDO in a standardized way. This allows you to switch between them fairly easily and it also allows you to code without worrying about catching exceptions that are specific to each technology.  
sect1
+ titleRef.   /chapter[1]/sect1[2]/title[1]
OriginalTraduction
Consistent Exception Hierarchy  
+ paraRef.   /chapter[1]/sect1[2]/para[1]
OriginalTraduction
Spring provides a convenient translation from technology specific exceptions like SQLException to its own exception hierarchy with the DataAccessException as the root exception. These exceptions wrap the original exception so there is never any risk that you would lose any information as to what might have gone wrong.  
+ paraRef.   /chapter[1]/sect1[2]/para[2]
OriginalTraduction
In addition to JDBC exceptions, Spring can also wrap Hibernate exceptions, converting them from proprietary, checked exceptions, to a set of abstracted runtime exceptions. The same is true for JDO exceptions. This allows you to handle most persistence exceptions, which are non-recoverable, only in the appropriate layers, without annoying boilerplate catches/throws, and exception declarations. You can still trap and handle exceptions anywhere you need to. As we mentioned above, JDBC exceptions (including DB specific dialects) are also converted to the same hierarchy, meaning that you can perform some operations with JDBC within a consistent programming model.  
+ paraRef.   /chapter[1]/sect1[2]/para[3]
OriginalTraduction
The above is true for the Template versions of the ORM access framework. If you use the Interceptor based classes then the application must care about handling HibernateExceptions and JDOExceptions itself, preferably via delegating to SessionFactoryUtils' convertHibernateAccessException or convertJdoAccessException methods respectively. These methods converts the exceptions to ones that are compatible with the org.springframework.dao exception hierarchy. As JDOExceptions are unchecked, they can simply get thrown too, sacrificing generic DAO abstraction in terms of exceptions though.  
+ paraRef.   /chapter[1]/sect1[2]/para[4]
OriginalTraduction
The exception hierarchy that Spring uses is outlined in the following graph:  
sect1
+ titleRef.   /chapter[1]/sect1[3]/title[1]
OriginalTraduction
Consistent Abstract Classes for DAO Support  
+ paraRef.   /chapter[1]/sect1[3]/para[1]
OriginalTraduction
To make it easier to work with a variety of data access technologies like JDBC, JDO and Hibernate in a consistent way, Spring provides a set of abstract DAO classes that you can extend. These abstract classes has methods for setting the data source and any other configuration settings that are specific to the technology you currently are using.  
+ paraRef.   /chapter[1]/sect1[3]/para[2]
OriginalTraduction
Dao Support classes:  
+ paraRef.   /chapter[1]/sect1[3]/itemizedlist[1]/listitem[1]/para[1]
OriginalTraduction
JdbcDaoSupport - super class for JDBC data access objects. Requires a DataSource to be set, providing a JdbcTemplate based on it to subclasses.  
+ paraRef.   /chapter[1]/sect1[3]/itemizedlist[1]/listitem[2]/para[1]
OriginalTraduction
HibernateDaoSupport - super class for Hibernate data access objects. Requires a SessionFactory to be set, providing a HibernateTemplate based on it to subclasses. Can alternatively be initialized directly via a HibernateTemplate, to reuse the latter's settings like SessionFactory, flush mode, exception translator, etc.  
+ paraRef.   /chapter[1]/sect1[3]/itemizedlist[1]/listitem[3]/para[1]
OriginalTraduction
JdoDaoSupport - super class for JDO data access objects. Requires a PersistenceManagerFactory to be set, providing a JdoTemplate based on it to subclasses.  


Index des chapitres