Java Doc for JdoOperations.java in  » J2EE » spring-framework-2.0.6 » org » springframework » orm » jdo » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » spring framework 2.0.6 » org.springframework.orm.jdo 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.springframework.orm.jdo.JdoOperations

All known Subclasses:   org.springframework.orm.jdo.JdoTemplate,
JdoOperations
public interface JdoOperations (Code)
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 org.springframework.orm.jdo.support.OpenPersistenceManagerInViewFilter / org.springframework.orm.jdo.support.OpenPersistenceManagerInViewInterceptor . Furthermore, some operations just make sense within transactions, for example: evict, evictAll, flush.

Updated to expose JDO 2.0 functionality, as of Spring 1.2: detachCopy, attachCopy, findByNamedQuery, etc. Those operations will by default only work on top of the standard JDO 2.0 API. Since Spring 1.2.2, the execution of those operations can also be adapted through the JdoDialect mechanism (for example, for vendor-specific pre-JDO2 methods).
author:
   Juergen Hoeller
since:
   1.1
See Also:   JdoTemplate
See Also:   javax.jdo.PersistenceManager
See Also:   JdoTransactionManager
See Also:   JdoDialect
See Also:   org.springframework.orm.jdo.support.OpenPersistenceManagerInViewFilter
See Also:   org.springframework.orm.jdo.support.OpenPersistenceManagerInViewInterceptor





Method Summary
 ObjectattachCopy(Object detachedEntity)
     Reattach the given detached instance (for example, a web form object) with the current JDO transaction, merging its changes into the current persistence instance that represents the corresponding entity.

Only available on JDO 2.0+ or through a vendor-specific JdoDialect. Note that as of JDO 2.0 final, this operation is equivalent to a makePersistent call.

 CollectionattachCopyAll(Collection detachedEntities)
     Reattach the given detached instances (for example, web form objects) with the current JDO transaction, merging their changes into the current persistence instances that represent the corresponding entities.

Only available on JDO 2.0+ or through a vendor-specific JdoDialect. Note that as of JDO 2.0 final, this operation is equivalent to a makePersistentAll call.

 voiddeletePersistent(Object entity)
     Delete the given persistent instance.
 voiddeletePersistentAll(Collection entities)
     Delete all given persistent instances.
 ObjectdetachCopy(Object entity)
     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).
 CollectiondetachCopyAll(Collection entities)
     Detach copies of the given persistent instances from the current JDO transaction, for use outside a JDO transaction (for example, as web form objects).
 voidevict(Object entity)
     Remove the given object from the PersistenceManager cache.
 voidevictAll(Collection entities)
     Remove all given objects from the PersistenceManager cache.
 voidevictAll()
     Remove all objects from the PersistenceManager cache.
 Objectexecute(JdoCallback action)
     Execute the action specified by the given action object within a PersistenceManager.
 CollectionexecuteFind(JdoCallback action)
     Execute the specified action assuming that the result object is a Collection.
 Collectionfind(Class entityClass)
     Find all persistent instances of the given class.
 Collectionfind(Class entityClass, String filter)
     Find all persistent instances of the given class that match the given JDOQL filter.
 Collectionfind(Class entityClass, String filter, String ordering)
     Find all persistent instances of the given class that match the given JDOQL filter, with the given result ordering.
 Collectionfind(Class entityClass, String filter, String parameters, Object[] values)
     Find all persistent instances of the given class that match the given JDOQL filter, using the given parameter declarations and parameter values.
 Collectionfind(Class entityClass, String filter, String parameters, Object[] values, String ordering)
     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.
 Collectionfind(Class entityClass, String filter, String parameters, Map values)
     Find all persistent instances of the given class that match the given JDOQL filter, using the given parameter declarations and parameter values.
 Collectionfind(Class entityClass, String filter, String parameters, Map values, String ordering)
     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.
 Collectionfind(String language, Object queryObject)
     Find persistent instances through the given query object in the specified query language.
 Collectionfind(String queryString)
     Find persistent instances through the given single-string JDOQL query.
 Collectionfind(String queryString, Object[] values)
     Find persistent instances through the given single-string JDOQL query.
 Collectionfind(String queryString, Map values)
     Find persistent instances through the given single-string JDOQL query.
 CollectionfindByNamedQuery(Class entityClass, String queryName)
     Find persistent instances through the given named query.
 CollectionfindByNamedQuery(Class entityClass, String queryName, Object[] values)
     Find persistent instances through the given named query.
 CollectionfindByNamedQuery(Class entityClass, String queryName, Map values)
     Find persistent instances through the given named query.
 voidflush()
     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.

 ObjectgetObjectById(Object objectId)
     Return the persistent instance with the given JDO object id, throwing an exception if not found.
 ObjectgetObjectById(Class entityClass, Object idValue)
     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.

 voidmakePersistent(Object entity)
     Make the given transient instance persistent.
 voidmakePersistentAll(Collection entities)
     Make the given transient instances persistent.
 voidrefresh(Object entity)
     Re-read the state of the given persistent instance.
 voidrefreshAll(Collection entities)
     Re-read the state of all given persistent instances.
 voidrefreshAll()
     Re-read the state of all persistent instances.



Method Detail
attachCopy
Object attachCopy(Object detachedEntity)(Code)
Reattach the given detached instance (for example, a web form object) with the current JDO transaction, merging its changes into the current persistence instance that represents the corresponding entity.

Only available on JDO 2.0+ or through a vendor-specific JdoDialect. Note that as of JDO 2.0 final, this operation is equivalent to a makePersistent call. This dedicated reattach operation now solely serves as distinction point for custom JdoDialects. It is still recommended to call this operation for enhanced adaptability.
Parameters:
  detachedEntity - the detached instance to attach the corresponding persistent instance
See Also:   javax.jdo.PersistenceManager.makePersistent(Object)




attachCopyAll
Collection attachCopyAll(Collection detachedEntities)(Code)
Reattach the given detached instances (for example, web form objects) with the current JDO transaction, merging their changes into the current persistence instances that represent the corresponding entities.

Only available on JDO 2.0+ or through a vendor-specific JdoDialect. Note that as of JDO 2.0 final, this operation is equivalent to a makePersistentAll call. This dedicated reattach operation now solely serves as distinction point for custom JdoDialects. It is still recommended to call this operation for enhanced adaptability.
Parameters:
  detachedEntities - the detached instances to reattach the corresponding persistent instances
See Also:   javax.jdo.PersistenceManager.makePersistentAll(java.util.Collection)




deletePersistent
void deletePersistent(Object entity) throws DataAccessException(Code)
Delete the given persistent instance.
Parameters:
  entity - the persistent instance to delete
throws:
  org.springframework.dao.DataAccessException - in case of JDO errors
See Also:   javax.jdo.PersistenceManager.deletePersistent(Object)



deletePersistentAll
void deletePersistentAll(Collection entities) throws DataAccessException(Code)
Delete all given persistent instances.

This can be combined with any of the find methods to delete by query in two lines of code.
Parameters:
  entities - the persistent instances to delete
throws:
  org.springframework.dao.DataAccessException - in case of JDO errors
See Also:   javax.jdo.PersistenceManager.deletePersistentAll(java.util.Collection)




detachCopy
Object detachCopy(Object entity)(Code)
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).

Only available on JDO 2.0+ or through a vendor-specific JdoDialect.
Parameters:
  entity - the persistent instance to detach
See Also:   javax.jdo.PersistenceManager.detachCopy(Object)




detachCopyAll
Collection detachCopyAll(Collection entities)(Code)
Detach copies of the given persistent instances from the current JDO transaction, for use outside a JDO transaction (for example, as web form objects).

Only available on JDO 2.0+ or through a vendor-specific JdoDialect.
Parameters:
  entities - the persistent instances to detach
See Also:   javax.jdo.PersistenceManager.detachCopyAll(Collection)




evict
void evict(Object entity) throws DataAccessException(Code)
Remove the given object from the PersistenceManager cache.
Parameters:
  entity - the persistent instance to evict
throws:
  org.springframework.dao.DataAccessException - in case of JDO errors
See Also:   javax.jdo.PersistenceManager.evict(Object)



evictAll
void evictAll(Collection entities) throws DataAccessException(Code)
Remove all given objects from the PersistenceManager cache.
Parameters:
  entities - the persistent instances to evict
throws:
  org.springframework.dao.DataAccessException - in case of JDO errors
See Also:   javax.jdo.PersistenceManager.evictAll(java.util.Collection)



evictAll
void evictAll() throws DataAccessException(Code)
Remove all objects from the PersistenceManager cache.
throws:
  org.springframework.dao.DataAccessException - in case of JDO errors
See Also:   javax.jdo.PersistenceManager.evictAll



execute
Object execute(JdoCallback action) throws DataAccessException(Code)
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.
Parameters:
  action - callback object that specifies the JDO action a result object returned by the action, or null
throws:
  org.springframework.dao.DataAccessException - in case of JDO errors
See Also:   JdoTransactionManager
See Also:   org.springframework.dao
See Also:   org.springframework.transaction
See Also:   javax.jdo.PersistenceManager




executeFind
Collection executeFind(JdoCallback action) throws DataAccessException(Code)
Execute the specified action assuming that the result object is a Collection. This is a convenience method for executing JDO queries within an action.
Parameters:
  action - callback object that specifies the JDO action a Collection result returned by the action, or null
throws:
  org.springframework.dao.DataAccessException - in case of JDO errors



find
Collection find(Class entityClass) throws DataAccessException(Code)
Find all persistent instances of the given class.
Parameters:
  entityClass - a persistent class the persistent instances
throws:
  org.springframework.dao.DataAccessException - in case of JDO errors
See Also:   javax.jdo.PersistenceManager.newQuery(Class)



find
Collection find(Class entityClass, String filter) throws DataAccessException(Code)
Find all persistent instances of the given class that match the given JDOQL filter.
Parameters:
  entityClass - a persistent class
Parameters:
  filter - the JDOQL filter to match (or null if none) the persistent instances
throws:
  org.springframework.dao.DataAccessException - in case of JDO errors
See Also:   javax.jdo.PersistenceManager.newQuery(ClassString)



find
Collection find(Class entityClass, String filter, String ordering) throws DataAccessException(Code)
Find all persistent instances of the given class that match the given JDOQL filter, with the given result ordering.
Parameters:
  entityClass - a persistent class
Parameters:
  filter - the JDOQL filter to match (or null if none)
Parameters:
  ordering - the ordering of the result (or null if none) the persistent instances
throws:
  org.springframework.dao.DataAccessException - in case of JDO errors
See Also:   javax.jdo.PersistenceManager.newQuery(ClassString)
See Also:   javax.jdo.Query.setOrdering



find
Collection find(Class entityClass, String filter, String parameters, Object[] values) throws DataAccessException(Code)
Find all persistent instances of the given class that match the given JDOQL filter, using the given parameter declarations and parameter values.
Parameters:
  entityClass - a persistent class
Parameters:
  filter - the JDOQL filter to match
Parameters:
  parameters - the JDOQL parameter declarations
Parameters:
  values - the corresponding parameter values the persistent instances
throws:
  org.springframework.dao.DataAccessException - in case of JDO errors
See Also:   javax.jdo.PersistenceManager.newQuery(ClassString)
See Also:   javax.jdo.Query.declareParameters
See Also:   javax.jdo.Query.executeWithArray



find
Collection find(Class entityClass, String filter, String parameters, Object[] values, String ordering) throws DataAccessException(Code)
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.
Parameters:
  entityClass - a persistent class
Parameters:
  filter - the JDOQL filter to match
Parameters:
  parameters - the JDOQL parameter declarations
Parameters:
  values - the corresponding parameter values
Parameters:
  ordering - the ordering of the result (or null if none) the persistent instances
throws:
  org.springframework.dao.DataAccessException - in case of JDO errors
See Also:   javax.jdo.PersistenceManager.newQuery(ClassString)
See Also:   javax.jdo.Query.declareParameters
See Also:   javax.jdo.Query.executeWithArray
See Also:   javax.jdo.Query.setOrdering



find
Collection find(Class entityClass, String filter, String parameters, Map values) throws DataAccessException(Code)
Find all persistent instances of the given class that match the given JDOQL filter, using the given parameter declarations and parameter values.
Parameters:
  entityClass - a persistent class
Parameters:
  filter - the JDOQL filter to match
Parameters:
  parameters - the JDOQL parameter declarations
Parameters:
  values - a Map with parameter names as keys and parameter values the persistent instances
throws:
  org.springframework.dao.DataAccessException - in case of JDO errors
See Also:   javax.jdo.PersistenceManager.newQuery(ClassString)
See Also:   javax.jdo.Query.declareParameters
See Also:   javax.jdo.Query.executeWithMap



find
Collection find(Class entityClass, String filter, String parameters, Map values, String ordering) throws DataAccessException(Code)
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.
Parameters:
  entityClass - a persistent class
Parameters:
  filter - the JDOQL filter to match
Parameters:
  parameters - the JDOQL parameter declarations
Parameters:
  values - a Map with parameter names as keys and parameter values
Parameters:
  ordering - the ordering of the result (or null if none) the persistent instances
throws:
  org.springframework.dao.DataAccessException - in case of JDO errors
See Also:   javax.jdo.PersistenceManager.newQuery(ClassString)
See Also:   javax.jdo.Query.declareParameters
See Also:   javax.jdo.Query.executeWithMap
See Also:   javax.jdo.Query.setOrdering



find
Collection find(String language, Object queryObject) throws DataAccessException(Code)
Find persistent instances through the given query object in the specified query language.

Only available on JDO 2.0 and higher.
Parameters:
  language - the query language (javax.jdo.Query#JDOQLor javax.jdo.Query#SQL, for example)
Parameters:
  queryObject - the query object for the specified language the persistent instances
throws:
  org.springframework.dao.DataAccessException - in case of JDO errors
See Also:   javax.jdo.PersistenceManager.newQuery(StringObject)
See Also:   javax.jdo.Query.JDOQL
See Also:   javax.jdo.Query.SQL




find
Collection find(String queryString) throws DataAccessException(Code)
Find persistent instances through the given single-string JDOQL query.

Only available on JDO 2.0 and higher.
Parameters:
  queryString - the single-string JDOQL query the persistent instances
throws:
  org.springframework.dao.DataAccessException - in case of JDO errors
See Also:   javax.jdo.PersistenceManager.newQuery(String)




find
Collection find(String queryString, Object[] values) throws DataAccessException(Code)
Find persistent instances through the given single-string JDOQL query.

Only available on JDO 2.0 and higher.
Parameters:
  queryString - the single-string JDOQL query
Parameters:
  values - the corresponding parameter values the persistent instances
throws:
  org.springframework.dao.DataAccessException - in case of JDO errors
See Also:   javax.jdo.PersistenceManager.newQuery(String)




find
Collection find(String queryString, Map values) throws DataAccessException(Code)
Find persistent instances through the given single-string JDOQL query.

Only available on JDO 2.0 and higher.
Parameters:
  queryString - the single-string JDOQL query
Parameters:
  values - a Map with parameter names as keys and parameter values the persistent instances
throws:
  org.springframework.dao.DataAccessException - in case of JDO errors
See Also:   javax.jdo.PersistenceManager.newQuery(String)




findByNamedQuery
Collection findByNamedQuery(Class entityClass, String queryName) throws DataAccessException(Code)
Find persistent instances through the given named query.

Only available on JDO 2.0+ or through a vendor-specific JdoDialect.
Parameters:
  entityClass - a persistent class
Parameters:
  queryName - the name of the query the persistent instances
throws:
  org.springframework.dao.DataAccessException - in case of JDO errors
See Also:   javax.jdo.PersistenceManager.newNamedQuery(ClassString)




findByNamedQuery
Collection findByNamedQuery(Class entityClass, String queryName, Object[] values) throws DataAccessException(Code)
Find persistent instances through the given named query.

Only available on JDO 2.0+ or through a vendor-specific JdoDialect.
Parameters:
  entityClass - a persistent class
Parameters:
  queryName - the name of the query
Parameters:
  values - the corresponding parameter values the persistent instances
throws:
  org.springframework.dao.DataAccessException - in case of JDO errors
See Also:   javax.jdo.PersistenceManager.newNamedQuery(ClassString)




findByNamedQuery
Collection findByNamedQuery(Class entityClass, String queryName, Map values) throws DataAccessException(Code)
Find persistent instances through the given named query.

Only available on JDO 2.0+ or through a vendor-specific JdoDialect.
Parameters:
  entityClass - a persistent class
Parameters:
  queryName - the name of the query
Parameters:
  values - a Map with parameter names as keys and parameter values the persistent instances
throws:
  org.springframework.dao.DataAccessException - in case of JDO errors
See Also:   javax.jdo.PersistenceManager.newNamedQuery(ClassString)




flush
void flush() throws DataAccessException(Code)
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.

Only available on JDO 2.0+ or through a vendor-specific JdoDialect.
throws:
  org.springframework.dao.DataAccessException - in case of JDO errors
See Also:   javax.jdo.PersistenceManager.flush
See Also:   JdoDialect.flush(javax.jdo.PersistenceManager)




getObjectById
Object getObjectById(Object objectId) throws DataAccessException(Code)
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.
Parameters:
  objectId - a JDO object id of the persistent instance the persistent instance
throws:
  org.springframework.orm.ObjectRetrievalFailureException - if not found
throws:
  org.springframework.dao.DataAccessException - in case of JDO errors
See Also:   javax.jdo.PersistenceManager.getObjectById(Objectboolean)




getObjectById
Object getObjectById(Class entityClass, Object idValue) throws DataAccessException(Code)
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.
Parameters:
  entityClass - a persistent class
Parameters:
  idValue - an id value of the persistent instance the persistent instance
throws:
  org.springframework.orm.ObjectRetrievalFailureException - if not found
throws:
  org.springframework.dao.DataAccessException - in case of JDO errors
See Also:   javax.jdo.PersistenceManager.getObjectById(Objectboolean)
See Also:   javax.jdo.PersistenceManager.getObjectById(ClassObject)




makePersistent
void makePersistent(Object entity) throws DataAccessException(Code)
Make the given transient instance persistent.
Parameters:
  entity - the transient instance to make persistent
throws:
  org.springframework.dao.DataAccessException - in case of JDO errors
See Also:   javax.jdo.PersistenceManager.makePersistent(Object)



makePersistentAll
void makePersistentAll(Collection entities) throws DataAccessException(Code)
Make the given transient instances persistent.
Parameters:
  entities - the transient instances to make persistent
throws:
  org.springframework.dao.DataAccessException - in case of JDO errors
See Also:   javax.jdo.PersistenceManager.makePersistentAll(java.util.Collection)



refresh
void refresh(Object entity) throws DataAccessException(Code)
Re-read the state of the given persistent instance.
Parameters:
  entity - the persistent instance to re-read
throws:
  org.springframework.dao.DataAccessException - in case of JDO errors
See Also:   javax.jdo.PersistenceManager.refresh(Object)



refreshAll
void refreshAll(Collection entities) throws DataAccessException(Code)
Re-read the state of all given persistent instances.
Parameters:
  entities - the persistent instances to re-read
throws:
  org.springframework.dao.DataAccessException - in case of JDO errors
See Also:   javax.jdo.PersistenceManager.refreshAll(java.util.Collection)



refreshAll
void refreshAll() throws DataAccessException(Code)
Re-read the state of all persistent instances.
throws:
  org.springframework.dao.DataAccessException - in case of JDO errors
See Also:   javax.jdo.PersistenceManager.refreshAll



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.