|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.orm.toplink.TopLinkAccessor
public abstract class TopLinkAccessor
Base class for TopLinkTemplate and TopLinkInterceptor, defining common properties like SessionFactory and JDBC exception translator.
Not intended to be used directly. See TopLinkTemplate and TopLinkInterceptor.
Thanks to Slavik Markovich for implementing the initial TopLink support prototype!
TopLinkTemplate
,
TopLinkInterceptor
Field Summary | |
---|---|
protected Log |
logger
|
Constructor Summary | |
---|---|
TopLinkAccessor()
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
Check that we were provided with a session to use |
protected DataAccessException |
convertJdbcAccessException(SQLException ex)
Convert the given SQLException to an appropriate exception from the org.springframework.dao hierarchy. |
DataAccessException |
convertTopLinkAccessException(oracle.toplink.exceptions.TopLinkException ex)
Convert the given TopLinkException to an appropriate exception from the org.springframework.dao hierarchy. |
SQLExceptionTranslator |
getJdbcExceptionTranslator()
Return the JDBC exception translator for this instance. |
SessionFactory |
getSessionFactory()
Return the TopLink SessionFactory that should be used to create TopLink Sessions. |
void |
setJdbcExceptionTranslator(SQLExceptionTranslator jdbcExceptionTranslator)
Set the JDBC exception translator for this instance. |
void |
setSessionFactory(SessionFactory sessionFactory)
Set the the TopLink SessionFactory that should be used to create TopLink Sessions. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final Log logger
Constructor Detail |
---|
public TopLinkAccessor()
Method Detail |
---|
public void setSessionFactory(SessionFactory sessionFactory)
The passed-in SessionFactory will usually be asked for a plain Session to perform data access on, unless an active transaction with a thread-bound Session is found.
public SessionFactory getSessionFactory()
public void setJdbcExceptionTranslator(SQLExceptionTranslator jdbcExceptionTranslator)
The default exception translator is a SQLStateSQLExceptionTranslator.
jdbcExceptionTranslator
- the exception translatorDatabaseException
,
SQLErrorCodeSQLExceptionTranslator
,
SQLStateSQLExceptionTranslator
public SQLExceptionTranslator getJdbcExceptionTranslator()
Creates a default SQLStateSQLExceptionTranslator, if no exception translator explicitly specified.
public void afterPropertiesSet()
afterPropertiesSet
in interface InitializingBean
public DataAccessException convertTopLinkAccessException(oracle.toplink.exceptions.TopLinkException ex)
org.springframework.dao
hierarchy. Will automatically detect
wrapped SQLExceptions and convert them accordingly.
The default implementation delegates to TopLinkUtils and convertJdbcAccessException. Can be overridden in subclasses.
ex
- TopLinkException that occured
convertJdbcAccessException(java.sql.SQLException)
,
SessionFactoryUtils.convertTopLinkAccessException(oracle.toplink.exceptions.TopLinkException)
protected DataAccessException convertJdbcAccessException(SQLException ex)
org.springframework.dao
hierarchy. Can be overridden in subclasses.
ex
- SQLException that occured
setJdbcExceptionTranslator(org.springframework.jdbc.support.SQLExceptionTranslator)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |