|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
TransactionAwarePersistenceManagerFactoryProxy
and
SpringPersistenceManagerProxyBean
)
@Deprecated public interface JdoOperations
Interface that specifies a basic set of JDO operations,
implemented by JdoTemplate
. Not often used, but a useful
option to enhance testability, as it can easily be mocked or stubbed.
Defines JdoTemplate
's data access methods that mirror
various JDO PersistenceManager
methods. Users are
strongly encouraged to read the JDO PersistenceManager
javadocs for details on the semantics of those methods.
Note that lazy loading will just work with an open JDO
PersistenceManager
, either within a managed transaction or within
OpenPersistenceManagerInViewFilter
/
OpenPersistenceManagerInViewInterceptor
.
Furthermore, some operations just make sense within transactions,
for example: evict
, evictAll
, flush
.
Updated to build on JDO 2.0 or higher, as of Spring 2.5.
JdoTemplate
,
PersistenceManager
,
JdoTransactionManager
,
JdoDialect
,
OpenPersistenceManagerInViewFilter
,
OpenPersistenceManagerInViewInterceptor
Method Summary | ||
---|---|---|
void |
deletePersistent(Object entity)
Deprecated. Delete the given persistent instance. |
|
void |
deletePersistentAll(Collection entities)
Deprecated. Delete all given persistent instances. |
|
|
detachCopy(T entity)
Deprecated. Detach a copy of the given persistent instance from the current JDO transaction, for use outside a JDO transaction (for example, as web form object). |
|
|
detachCopyAll(Collection<T> entities)
Deprecated. Detach copies of the given persistent instances from the current JDO transaction, for use outside a JDO transaction (for example, as web form objects). |
|
void |
evict(Object entity)
Deprecated. Remove the given object from the PersistenceManager cache. |
|
void |
evictAll()
Deprecated. Remove all objects from the PersistenceManager cache. |
|
void |
evictAll(Collection entities)
Deprecated. Remove all given objects from the PersistenceManager cache. |
|
|
execute(JdoCallback<T> action)
Deprecated. Execute the action specified by the given action object within a PersistenceManager. |
|
Collection |
executeFind(JdoCallback<?> action)
Deprecated. Execute the specified action assuming that the result object is a Collection. |
|
|
find(Class<T> entityClass)
Deprecated. Find all persistent instances of the given class. |
|
|
find(Class<T> entityClass,
String filter)
Deprecated. Find all persistent instances of the given class that match the given JDOQL filter. |
|
|
find(Class<T> entityClass,
String filter,
String ordering)
Deprecated. Find all persistent instances of the given class that match the given JDOQL filter, with the given result ordering. |
|
|
find(Class<T> entityClass,
String filter,
String parameters,
Map<String,?> values)
Deprecated. Find all persistent instances of the given class that match the given JDOQL filter, using the given parameter declarations and parameter values. |
|
|
find(Class<T> entityClass,
String filter,
String parameters,
Map<String,?> values,
String ordering)
Deprecated. Find all persistent instances of the given class that match the given JDOQL filter, using the given parameter declarations and parameter values, with the given result ordering. |
|
|
find(Class<T> entityClass,
String filter,
String parameters,
Object... values)
Deprecated. Find all persistent instances of the given class that match the given JDOQL filter, using the given parameter declarations and parameter values. |
|
|
find(Class<T> entityClass,
String filter,
String parameters,
Object[] values,
String ordering)
Deprecated. Find all persistent instances of the given class that match the given JDOQL filter, using the given parameter declarations and parameter values, with the given result ordering. |
|
Collection |
find(String queryString)
Deprecated. Find persistent instances through the given single-string JDOQL query. |
|
Collection |
find(String queryString,
Map<String,?> values)
Deprecated. Find persistent instances through the given single-string JDOQL query. |
|
Collection |
find(String queryString,
Object... values)
Deprecated. Find persistent instances through the given single-string JDOQL query. |
|
Collection |
find(String language,
Object queryObject)
Deprecated. Find persistent instances through the given query object in the specified query language. |
|
|
findByNamedQuery(Class<T> entityClass,
String queryName)
Deprecated. Find persistent instances through the given named query. |
|
|
findByNamedQuery(Class<T> entityClass,
String queryName,
Map<String,?> values)
Deprecated. Find persistent instances through the given named query. |
|
|
findByNamedQuery(Class<T> entityClass,
String queryName,
Object... values)
Deprecated. Find persistent instances through the given named query. |
|
void |
flush()
Deprecated. Flush all transactional modifications to the database. |
|
|
getObjectById(Class<T> entityClass,
Object idValue)
Deprecated. Return the persistent instance of the given entity class with the given id value, throwing an exception if not found. |
|
Object |
getObjectById(Object objectId)
Deprecated. Return the persistent instance with the given JDO object id, throwing an exception if not found. |
|
|
makePersistent(T entity)
Deprecated. Make the given transient instance persistent. |
|
|
makePersistentAll(Collection<T> entities)
Deprecated. Make the given transient instances persistent. |
|
void |
refresh(Object entity)
Deprecated. Re-read the state of the given persistent instance. |
|
void |
refreshAll()
Deprecated. Re-read the state of all persistent instances. |
|
void |
refreshAll(Collection entities)
Deprecated. Re-read the state of all given persistent instances. |
Method Detail |
---|
<T> T execute(JdoCallback<T> action) throws DataAccessException
Note: Callback code is not supposed to handle transactions itself! Use an appropriate transaction manager like JdoTransactionManager.
action
- callback object that specifies the JDO action
null
DataAccessException
- in case of JDO errorsJdoTransactionManager
,
org.springframework.dao
,
org.springframework.transaction
,
PersistenceManager
Collection executeFind(JdoCallback<?> action) throws DataAccessException
action
- callback object that specifies the JDO action
null
DataAccessException
- in case of JDO errorsObject getObjectById(Object objectId) throws DataAccessException
A JDO object id identifies both the persistent class and the id within the namespace of that class.
objectId
- a JDO object id of the persistent instance
ObjectRetrievalFailureException
- if not found
DataAccessException
- in case of JDO errorsPersistenceManager.getObjectById(Object, boolean)
<T> T getObjectById(Class<T> entityClass, Object idValue) throws DataAccessException
The given id value is typically just unique within the namespace of the persistent class. Its toString value must correspond to the toString value of the corresponding JDO object id.
Usually, the passed-in value will have originated from the primary key field of a persistent object that uses JDO's application identity.
entityClass
- a persistent classidValue
- an id value of the persistent instance
ObjectRetrievalFailureException
- if not found
DataAccessException
- in case of JDO errorsPersistenceManager.getObjectById(Object, boolean)
,
PersistenceManager.getObjectById(Class, Object)
void evict(Object entity) throws DataAccessException
entity
- the persistent instance to evict
DataAccessException
- in case of JDO errorsPersistenceManager.evict(Object)
void evictAll(Collection entities) throws DataAccessException
entities
- the persistent instances to evict
DataAccessException
- in case of JDO errorsPersistenceManager.evictAll(java.util.Collection)
void evictAll() throws DataAccessException
DataAccessException
- in case of JDO errorsPersistenceManager.evictAll()
void refresh(Object entity) throws DataAccessException
entity
- the persistent instance to re-read
DataAccessException
- in case of JDO errorsPersistenceManager.refresh(Object)
void refreshAll(Collection entities) throws DataAccessException
entities
- the persistent instances to re-read
DataAccessException
- in case of JDO errorsPersistenceManager.refreshAll(java.util.Collection)
void refreshAll() throws DataAccessException
DataAccessException
- in case of JDO errorsPersistenceManager.refreshAll()
<T> T makePersistent(T entity) throws DataAccessException
entity
- the transient instance to make persistent
DataAccessException
- in case of JDO errorsPersistenceManager.makePersistent(Object)
<T> Collection<T> makePersistentAll(Collection<T> entities) throws DataAccessException
entities
- the transient instances to make persistent
DataAccessException
- in case of JDO errorsPersistenceManager.makePersistentAll(java.util.Collection)
void deletePersistent(Object entity) throws DataAccessException
entity
- the persistent instance to delete
DataAccessException
- in case of JDO errorsPersistenceManager.deletePersistent(Object)
void deletePersistentAll(Collection entities) throws DataAccessException
This can be combined with any of the find methods to delete by query in two lines of code.
entities
- the persistent instances to delete
DataAccessException
- in case of JDO errorsPersistenceManager.deletePersistentAll(java.util.Collection)
<T> T detachCopy(T entity)
entity
- the persistent instance to detach
PersistenceManager.detachCopy(Object)
<T> Collection<T> detachCopyAll(Collection<T> entities)
entities
- the persistent instances to detach
PersistenceManager.detachCopyAll(Collection)
void flush() throws DataAccessException
Only invoke this for selective eager flushing, for example when JDBC code needs to see certain changes within the same transaction. Else, it's preferable to rely on auto-flushing at transaction completion.
DataAccessException
- in case of JDO errorsPersistenceManager.flush()
,
JdoDialect#flush(javax.jdo.PersistenceManager)
<T> Collection<T> find(Class<T> entityClass) throws DataAccessException
entityClass
- a persistent class
DataAccessException
- in case of JDO errorsPersistenceManager.newQuery(Class)
<T> Collection<T> find(Class<T> entityClass, String filter) throws DataAccessException
entityClass
- a persistent classfilter
- the JDOQL filter to match (or null
if none)
DataAccessException
- in case of JDO errorsPersistenceManager.newQuery(Class, String)
<T> Collection<T> find(Class<T> entityClass, String filter, String ordering) throws DataAccessException
entityClass
- a persistent classfilter
- the JDOQL filter to match (or null
if none)ordering
- the ordering of the result (or null
if none)
DataAccessException
- in case of JDO errorsPersistenceManager.newQuery(Class, String)
,
Query.setOrdering(java.lang.String)
<T> Collection<T> find(Class<T> entityClass, String filter, String parameters, Object... values) throws DataAccessException
entityClass
- a persistent classfilter
- the JDOQL filter to matchparameters
- the JDOQL parameter declarationsvalues
- the corresponding parameter values
DataAccessException
- in case of JDO errorsPersistenceManager.newQuery(Class, String)
,
Query.declareParameters(java.lang.String)
,
Query.executeWithArray(java.lang.Object...)
<T> Collection<T> find(Class<T> entityClass, String filter, String parameters, Object[] values, String ordering) throws DataAccessException
entityClass
- a persistent classfilter
- the JDOQL filter to matchparameters
- the JDOQL parameter declarationsvalues
- the corresponding parameter valuesordering
- the ordering of the result (or null
if none)
DataAccessException
- in case of JDO errorsPersistenceManager.newQuery(Class, String)
,
Query.declareParameters(java.lang.String)
,
Query.executeWithArray(java.lang.Object...)
,
Query.setOrdering(java.lang.String)
<T> Collection<T> find(Class<T> entityClass, String filter, String parameters, Map<String,?> values) throws DataAccessException
entityClass
- a persistent classfilter
- the JDOQL filter to matchparameters
- the JDOQL parameter declarationsvalues
- a Map with parameter names as keys and parameter values
DataAccessException
- in case of JDO errorsPersistenceManager.newQuery(Class, String)
,
Query.declareParameters(java.lang.String)
,
Query.executeWithMap(java.util.Map)
<T> Collection<T> find(Class<T> entityClass, String filter, String parameters, Map<String,?> values, String ordering) throws DataAccessException
entityClass
- a persistent classfilter
- the JDOQL filter to matchparameters
- the JDOQL parameter declarationsvalues
- a Map with parameter names as keys and parameter valuesordering
- the ordering of the result (or null
if none)
DataAccessException
- in case of JDO errorsPersistenceManager.newQuery(Class, String)
,
Query.declareParameters(java.lang.String)
,
Query.executeWithMap(java.util.Map)
,
Query.setOrdering(java.lang.String)
Collection find(String language, Object queryObject) throws DataAccessException
language
- the query language (javax.jdo.Query#JDOQL
or javax.jdo.Query#SQL
, for example)queryObject
- the query object for the specified language
DataAccessException
- in case of JDO errorsPersistenceManager.newQuery(String, Object)
,
Query.JDOQL
,
Query.SQL
Collection find(String queryString) throws DataAccessException
queryString
- the single-string JDOQL query
DataAccessException
- in case of JDO errorsPersistenceManager.newQuery(String)
Collection find(String queryString, Object... values) throws DataAccessException
queryString
- the single-string JDOQL queryvalues
- the corresponding parameter values
DataAccessException
- in case of JDO errorsPersistenceManager.newQuery(String)
Collection find(String queryString, Map<String,?> values) throws DataAccessException
queryString
- the single-string JDOQL queryvalues
- a Map with parameter names as keys and parameter values
DataAccessException
- in case of JDO errorsPersistenceManager.newQuery(String)
<T> Collection<T> findByNamedQuery(Class<T> entityClass, String queryName) throws DataAccessException
entityClass
- a persistent classqueryName
- the name of the query
DataAccessException
- in case of JDO errorsPersistenceManager.newNamedQuery(Class, String)
<T> Collection<T> findByNamedQuery(Class<T> entityClass, String queryName, Object... values) throws DataAccessException
entityClass
- a persistent classqueryName
- the name of the queryvalues
- the corresponding parameter values
DataAccessException
- in case of JDO errorsPersistenceManager.newNamedQuery(Class, String)
<T> Collection<T> findByNamedQuery(Class<T> entityClass, String queryName, Map<String,?> values) throws DataAccessException
entityClass
- a persistent classqueryName
- the name of the queryvalues
- a Map with parameter names as keys and parameter values
DataAccessException
- in case of JDO errorsPersistenceManager.newNamedQuery(Class, String)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |