|
||||||||||
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 such as 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
Logger available to subclasses |
Constructor Summary | |
---|---|
TopLinkAccessor()
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
Check that we were provided with a session to use |
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, if any. |
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.
ServerSessionFactory
,
SingleSessionFactory
,
SessionFactory.createSession()
,
SessionFactoryUtils.getSession(SessionFactory, boolean)
public SessionFactory getSessionFactory()
public void setJdbcExceptionTranslator(SQLExceptionTranslator jdbcExceptionTranslator)
Applied to any SQLException root cause of a TopLink DatabaseException. The default is to rely on TopLink's native exception translation.
jdbcExceptionTranslator
- the exception translatorDatabaseException
,
SQLErrorCodeSQLExceptionTranslator
,
SQLStateSQLExceptionTranslator
public SQLExceptionTranslator getJdbcExceptionTranslator()
public void afterPropertiesSet()
afterPropertiesSet
in interface InitializingBean
public DataAccessException convertTopLinkAccessException(oracle.toplink.exceptions.TopLinkException ex)
org.springframework.dao
hierarchy.
Will automatically apply a specified SQLExceptionTranslator to a TopLink DatabaseException, else rely on TopLink's default translation.
ex
- TopLinkException that occured
SessionFactoryUtils.convertTopLinkAccessException(oracle.toplink.exceptions.TopLinkException)
,
setJdbcExceptionTranslator(org.springframework.jdbc.support.SQLExceptionTranslator)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |