org.springframework.orm.jdo.JdoOperations |
Known Indirect Subclasses |
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 javax.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.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Delete the given persistent instance.
| |||||||||||
Delete all given persistent instances.
| |||||||||||
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).
| |||||||||||
Detach copies of the given persistent instances from the current JDO transaction,
for use outside a JDO transaction (for example, as web form objects).
| |||||||||||
Remove the given object from the PersistenceManager cache.
| |||||||||||
Remove all given objects from the PersistenceManager cache.
| |||||||||||
Remove all objects from the PersistenceManager cache.
| |||||||||||
Execute the action specified by the given action object within a
PersistenceManager.
| |||||||||||
Execute the specified action assuming that the result object is a
Collection.
| |||||||||||
Find all persistent instances of the given class that match the given
JDOQL filter, using the given parameter declarations and parameter values.
| |||||||||||
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 persistent instances through the given single-string JDOQL query.
| |||||||||||
Find persistent instances through the given single-string JDOQL query.
| |||||||||||
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 all persistent instances of the given class.
| |||||||||||
Find persistent instances through the given query object
in the specified query language.
| |||||||||||
Find persistent instances through the given single-string JDOQL query.
| |||||||||||
Find all persistent instances of the given class that match the given
JDOQL filter.
| |||||||||||
Find all persistent instances of the given class that match the given
JDOQL filter, using the given parameter declarations and parameter values.
| |||||||||||
Find all persistent instances of the given class that match the given
JDOQL filter, with the given result ordering.
| |||||||||||
Find persistent instances through the given named query.
| |||||||||||
Find persistent instances through the given named query.
| |||||||||||
Find persistent instances through the given named query.
| |||||||||||
Flush all transactional modifications to the database.
| |||||||||||
Return the persistent instance of the given entity class
with the given id value, throwing an exception if not found.
| |||||||||||
Return the persistent instance with the given JDO object id,
throwing an exception if not found.
| |||||||||||
Make the given transient instance persistent.
| |||||||||||
Make the given transient instances persistent.
| |||||||||||
Re-read the state of the given persistent instance.
| |||||||||||
Re-read the state of all given persistent instances.
| |||||||||||
Re-read the state of all persistent instances.
|
Delete the given persistent instance.
entity | the persistent instance to delete |
---|
DataAccessException | in case of JDO errors |
---|
Delete all given persistent instances.
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 errors |
---|
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).
entity | the persistent instance to detach |
---|
Detach copies of the given persistent instances from the current JDO transaction, for use outside a JDO transaction (for example, as web form objects).
entities | the persistent instances to detach |
---|
Remove the given object from the PersistenceManager cache.
entity | the persistent instance to evict |
---|
DataAccessException | in case of JDO errors |
---|
Remove all given objects from the PersistenceManager cache.
entities | the persistent instances to evict |
---|
DataAccessException | in case of JDO errors |
---|
Remove all objects from the PersistenceManager cache.
DataAccessException | in case of JDO errors |
---|
Execute the action specified by the given action object within a PersistenceManager. Application exceptions thrown by the action object get propagated to the caller (can only be unchecked). JDO exceptions are transformed into appropriate DAO ones. Allows for returning a result object, i.e. a domain object or a collection of domain objects.
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 errors |
---|
JdoTransactionManager
org.springframework.dao
org.springframework.transaction
Execute the specified action assuming that the result object is a Collection. This is a convenience method for executing JDO queries within an action.
action | callback object that specifies the JDO action |
---|
null
DataAccessException | in case of JDO errors |
---|
Find all persistent instances of the given class that match the given JDOQL filter, using the given parameter declarations and parameter values.
entityClass | a persistent class |
---|---|
filter | the JDOQL filter to match |
parameters | the JDOQL parameter declarations |
values | the corresponding parameter values |
DataAccessException | in case of JDO errors |
---|
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.
entityClass | a persistent class |
---|---|
filter | the JDOQL filter to match |
parameters | the JDOQL parameter declarations |
values | a Map with parameter names as keys and parameter values |
ordering | the ordering of the result (or null if none) |
DataAccessException | in case of JDO errors |
---|
Find persistent instances through the given single-string JDOQL query.
queryString | the single-string JDOQL query |
---|
DataAccessException | in case of JDO errors |
---|
Find persistent instances through the given single-string JDOQL query.
queryString | the single-string JDOQL query |
---|---|
values | a Map with parameter names as keys and parameter values |
DataAccessException | in case of JDO errors |
---|
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.
entityClass | a persistent class |
---|---|
filter | the JDOQL filter to match |
parameters | the JDOQL parameter declarations |
values | the corresponding parameter values |
ordering | the ordering of the result (or null if none) |
DataAccessException | in case of JDO errors |
---|
Find all persistent instances of the given class.
entityClass | a persistent class |
---|
DataAccessException | in case of JDO errors |
---|
Find persistent instances through the given query object in the specified query language.
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 errors |
---|
Find persistent instances through the given single-string JDOQL query.
queryString | the single-string JDOQL query |
---|---|
values | the corresponding parameter values |
DataAccessException | in case of JDO errors |
---|
Find all persistent instances of the given class that match the given JDOQL filter.
entityClass | a persistent class |
---|---|
filter | the JDOQL filter to match (or null if none) |
DataAccessException | in case of JDO errors |
---|
Find all persistent instances of the given class that match the given JDOQL filter, using the given parameter declarations and parameter values.
entityClass | a persistent class |
---|---|
filter | the JDOQL filter to match |
parameters | the JDOQL parameter declarations |
values | a Map with parameter names as keys and parameter values |
DataAccessException | in case of JDO errors |
---|
Find all persistent instances of the given class that match the given JDOQL filter, with the given result ordering.
entityClass | a persistent class |
---|---|
filter | the JDOQL filter to match (or null if none) |
ordering | the ordering of the result (or null if none) |
DataAccessException | in case of JDO errors |
---|
Find persistent instances through the given named query.
entityClass | a persistent class |
---|---|
queryName | the name of the query |
values | the corresponding parameter values |
DataAccessException | in case of JDO errors |
---|
Find persistent instances through the given named query.
entityClass | a persistent class |
---|---|
queryName | the name of the query |
values | a Map with parameter names as keys and parameter values |
DataAccessException | in case of JDO errors |
---|
Find persistent instances through the given named query.
entityClass | a persistent class |
---|---|
queryName | the name of the query |
DataAccessException | in case of JDO errors |
---|
Flush all transactional modifications to the database.
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 errors |
---|
Return the persistent instance of the given entity class with the given id value, throwing an exception if not found.
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 class |
---|---|
idValue | an id value of the persistent instance |
ObjectRetrievalFailureException | if not found |
---|---|
DataAccessException | in case of JDO errors |
Return the persistent instance with the given JDO object id, throwing an exception if not found.
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 errors |
Make the given transient instance persistent. Attach the given entity if the instance is detached.
entity | the transient instance to make persistent |
---|
DataAccessException | in case of JDO errors |
---|
Make the given transient instances persistent. Attach the given entities if the instances are detached.
entities | the transient instances to make persistent |
---|
DataAccessException | in case of JDO errors |
---|
Re-read the state of the given persistent instance.
entity | the persistent instance to re-read |
---|
DataAccessException | in case of JDO errors |
---|
Re-read the state of all given persistent instances.
entities | the persistent instances to re-read |
---|
DataAccessException | in case of JDO errors |
---|
Re-read the state of all persistent instances.
DataAccessException | in case of JDO errors |
---|