org.springframework.orm.ojb
Class OjbAccessor

java.lang.Object
  extended by org.springframework.jdbc.support.JdbcAccessor
      extended by org.springframework.orm.ojb.OjbAccessor
All Implemented Interfaces:
InitializingBean
Direct Known Subclasses:
PersistenceBrokerTemplate

public class OjbAccessor
extends JdbcAccessor

Base class for OJB-accessing classes, defining common properties like PBKey. Extends JdbcAccessor to inherit SQLException translation capabilities.

Not intended to be used directly. See PersistenceBrokerTemplate.

Since:
1.1
Author:
Juergen Hoeller
See Also:
PersistenceBrokerTemplate

Field Summary
 
Fields inherited from class org.springframework.jdbc.support.JdbcAccessor
logger
 
Constructor Summary
OjbAccessor()
           
 
Method Summary
protected  DataAccessException convertJdbcAccessException(SQLException ex)
          Convert the given SQLException to an appropriate exception from the org.springframework.dao hierarchy.
 DataAccessException convertOjbAccessException(org.apache.ojb.broker.PersistenceBrokerException ex)
          Convert the given PersistenceBrokerException to an appropriate exception from the org.springframework.dao hierarchy.
 String getJcdAlias()
          Return the JDBC Connection Descriptor alias of the PersistenceBroker configuration to use.
 org.apache.ojb.broker.PBKey getPbKey()
          Return the PBKey of the PersistenceBroker configuration used.
 void setJcdAlias(String jcdAlias)
          Set the JDBC Connection Descriptor alias of the PersistenceBroker configuration to use.
 void setPbKey(org.apache.ojb.broker.PBKey pbKey)
          Set the PBKey of the PersistenceBroker configuration to use.
 
Methods inherited from class org.springframework.jdbc.support.JdbcAccessor
afterPropertiesSet, getDataSource, getExceptionTranslator, isLazyInit, setDatabaseProductName, setDataSource, setExceptionTranslator, setLazyInit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OjbAccessor

public OjbAccessor()
Method Detail

setJcdAlias

public void setJcdAlias(String jcdAlias)
Set the JDBC Connection Descriptor alias of the PersistenceBroker configuration to use. Default is the default connection configured for OJB.


getJcdAlias

public String getJcdAlias()
Return the JDBC Connection Descriptor alias of the PersistenceBroker configuration to use.


setPbKey

public void setPbKey(org.apache.ojb.broker.PBKey pbKey)
Set the PBKey of the PersistenceBroker configuration to use. Default is the default connection configured for OJB.


getPbKey

public org.apache.ojb.broker.PBKey getPbKey()
Return the PBKey of the PersistenceBroker configuration used.


convertOjbAccessException

public DataAccessException convertOjbAccessException(org.apache.ojb.broker.PersistenceBrokerException ex)
Convert the given PersistenceBrokerException to an appropriate exception from the org.springframework.dao hierarchy. In case of a wrapped SQLException, the SQLExceptionTranslator inherited from the superclass gets applied. May be overridden in subclasses.

Parameters:
ex - PersistenceBrokerException that occured
Returns:
the corresponding DataAccessException instance
See Also:
JdbcAccessor.setExceptionTranslator(org.springframework.jdbc.support.SQLExceptionTranslator)

convertJdbcAccessException

protected DataAccessException convertJdbcAccessException(SQLException ex)
Convert the given SQLException to an appropriate exception from the org.springframework.dao hierarchy. Can be overridden in subclasses.

Note that SQLException can just occur here when callback code performs direct JDBC access via ConnectionManagerIF.getConnection().

Parameters:
ex - SQLException that occured
Returns:
the corresponding DataAccessException instance
See Also:
JdbcAccessor.setExceptionTranslator(org.springframework.jdbc.support.SQLExceptionTranslator), ConnectionManagerIF.getConnection()


Copyright (c) 2002-2007 The Spring Framework Project.