站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Spring Framework 1.2.9 API 文档英文版

PersistenceBrokerCallback (Spring Framework) - Spring Framework 1.2.9 API 文档英文版


org.springframework.orm.ojb
Interface PersistenceBrokerCallback


public interface PersistenceBrokerCallback

Callback interface for OJB PersistenceBroker code. To be used with PersistenceBrokerTemplate's execute method, assumably often as anonymous classes within a method implementation.

The typical implementation will call PersistenceBroker CRUD to perform some operations on persistent objects.

Since:
1.1
Author:
Juergen Hoeller
See Also:
PersistenceBrokerTemplate

Method Summary
 Object doInPersistenceBroker(org.apache.ojb.broker.PersistenceBroker pb)
          Gets called by PersistenceBrokerTemplate.execute with an active PersistenceBroker.
 

Method Detail

doInPersistenceBroker

Object doInPersistenceBroker(org.apache.ojb.broker.PersistenceBroker pb)
                             throws org.apache.ojb.broker.PersistenceBrokerException,
                                    org.apache.ojb.broker.accesslayer.LookupException,
                                    SQLException
Gets called by PersistenceBrokerTemplate.execute with an active PersistenceBroker. Does not need to care about activating or closing the PersistenceBroker, or handling transactions.

Allows for returning a result object created within the callback, i.e. a domain object or a collection of domain objects. A thrown RuntimeException is treated as application exception, it gets propagated to the caller of the template.

Parameters:
pb - active PersistenceBroker
Returns:
a result object, or null if none
Throws:
org.apache.ojb.broker.PersistenceBrokerException - in case of OJB errors
org.apache.ojb.broker.accesslayer.LookupException - if thrown by OJB lookup methods
SQLException - in case of errors on direct JDBC access
See Also:
PersistenceBrokerTemplate.execute(org.springframework.orm.ojb.PersistenceBrokerCallback)


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