类 CciDaoSupport
- java.lang.Object
- org.springframework.dao.support.DaoSupport
- org.springframework.jca.cci.core.support.CciDaoSupport
- 所有已实现的接口:
InitializingBean
public abstract class CciDaoSupport extends DaoSupport
Convenient super class for CCI-based data access objects.Requires a
ConnectionFactory
to be set, providing aCciTemplate
based on it to subclasses through thegetCciTemplate()
method.This base class is mainly intended for CciTemplate usage but can also be used when working with a Connection directly or when using
org.springframework.jca.cci.object
classes.- 从以下版本开始:
- 1.2
- 作者:
- Thierry Templier, Juergen Hoeller
- 另请参阅:
setConnectionFactory(javax.resource.cci.ConnectionFactory)
,getCciTemplate()
,CciTemplate
字段概要
从类继承的字段 org.springframework.dao.support.DaoSupport
logger
构造器概要
构造器 构造器 说明 CciDaoSupport()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected void
checkDaoConfig()
Abstract subclasses must override this to check their configuration.protected CciTemplate
createCciTemplate(ConnectionFactory connectionFactory)
Create a CciTemplate for the given ConnectionFactory.CciTemplate
getCciTemplate()
Return the CciTemplate for this DAO, pre-initialized with the ConnectionFactory or set explicitly.protected CciTemplate
getCciTemplate(ConnectionSpec connectionSpec)
Obtain a CciTemplate derived from the main template instance, inheriting the ConnectionFactory and other settings but overriding the ConnectionSpec used for obtaining Connections.protected Connection
getConnection()
Get a CCI Connection, either from the current transaction or a new one.ConnectionFactory
getConnectionFactory()
Return the ConnectionFactory used by this DAO.protected void
releaseConnection(Connection con)
Close the given CCI Connection, created via this bean's ConnectionFactory, if it isn't bound to the thread.void
setCciTemplate(CciTemplate cciTemplate)
Set the CciTemplate for this DAO explicitly, as an alternative to specifying a ConnectionFactory.void
setConnectionFactory(ConnectionFactory connectionFactory)
Set the ConnectionFactory to be used by this DAO.从类继承的方法 org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
构造器详细资料
CciDaoSupport
public CciDaoSupport()
方法详细资料
setConnectionFactory
public final void setConnectionFactory(ConnectionFactory connectionFactory)
Set the ConnectionFactory to be used by this DAO.
createCciTemplate
protected CciTemplate createCciTemplate(ConnectionFactory connectionFactory)
Create a CciTemplate for the given ConnectionFactory. Only invoked if populating the DAO with a ConnectionFactory reference!Can be overridden in subclasses to provide a CciTemplate instance with different configuration, or a custom CciTemplate subclass.
- 参数:
connectionFactory
- the CCI ConnectionFactory to create a CciTemplate for- 返回:
- the new CciTemplate instance
- 另请参阅:
setConnectionFactory(javax.resource.cci.ConnectionFactory)
getConnectionFactory
@Nullable public final ConnectionFactory getConnectionFactory()
Return the ConnectionFactory used by this DAO.
setCciTemplate
public final void setCciTemplate(CciTemplate cciTemplate)
Set the CciTemplate for this DAO explicitly, as an alternative to specifying a ConnectionFactory.
getCciTemplate
@Nullable public final CciTemplate getCciTemplate()
Return the CciTemplate for this DAO, pre-initialized with the ConnectionFactory or set explicitly.
checkDaoConfig
protected final void checkDaoConfig()
从类复制的说明:DaoSupport
Abstract subclasses must override this to check their configuration.Implementors should be marked as
final
if concrete subclasses are not supposed to override this template method themselves.- 指定者:
checkDaoConfig
在类中DaoSupport
getCciTemplate
protected final CciTemplate getCciTemplate(ConnectionSpec connectionSpec)
Obtain a CciTemplate derived from the main template instance, inheriting the ConnectionFactory and other settings but overriding the ConnectionSpec used for obtaining Connections.- 参数:
connectionSpec
- the CCI ConnectionSpec that the returned template instance is supposed to obtain Connections for- 返回:
- the derived template instance
- 另请参阅:
CciTemplate.getDerivedTemplate(javax.resource.cci.ConnectionSpec)
getConnection
protected final Connection getConnection() throws CannotGetCciConnectionException
Get a CCI Connection, either from the current transaction or a new one.- 返回:
- the CCI Connection
- 抛出:
CannotGetCciConnectionException
- if the attempt to get a Connection failed- 另请参阅:
ConnectionFactoryUtils.getConnection(javax.resource.cci.ConnectionFactory)
releaseConnection
protected final void releaseConnection(Connection con)
Close the given CCI Connection, created via this bean's ConnectionFactory, if it isn't bound to the thread.- 参数:
con
- the Connection to close- 另请参阅:
ConnectionFactoryUtils.releaseConnection(javax.resource.cci.Connection, javax.resource.cci.ConnectionFactory)