Java Doc for AbstractStoreManager.java in  » Database-ORM » openjpa » org » apache » openjpa » abstractstore » 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 » Database ORM » openjpa » org.apache.openjpa.abstractstore 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.openjpa.abstractstore.AbstractStoreManager

All known Subclasses:   org.apache.openjpa.xmlstore.XMLStoreManager,
AbstractStoreManager
abstract public class AbstractStoreManager implements StoreManager(Code)
Abstract store manager implementation to ease development of custom OpenJPA back-ends. A concrete subclass must define implementations for the following methods: Additionally, subclasses should not attempt to acquire resources until AbstractStoreManager.open has been called. Store manager instances might be created to call metadata methods such as AbstractStoreManager.newConfiguration or AbstractStoreManager.getUnsupportedOptions and never opened. These instances should not consume any data store resources. Notes:
since:
   0.3.1


Field Summary
protected  StoreContextctx
    


Method Summary
protected  booleanassignDataStoreId(OpenJPAStateManager sm, Object val)
     Assign a new datastore identity to the given instance.
public  booleanassignField(OpenJPAStateManager sm, int field, boolean preFlush)
    
public  booleanassignObjectId(OpenJPAStateManager sm, boolean preFlush)
    
public  voidbeforeStateChange(OpenJPAStateManager sm, PCState fromState, PCState toState)
    
public  voidbegin()
     OpenJPA assumes that after this method is invoked, all data accesses through this store manager will be part of a single unit of work that can be rolled back. This is a no-op implementation.
public  voidbeginOptimistic()
     No-op implementation.
public  booleancancelAll()
     Returns false.
public  voidclose()
    
public  voidcommit()
     This is a no-op implementation.
public  intcompareVersion(OpenJPAStateManager state, Object v1, Object v2)
     Casts v1 and v2 to Comparable , and invokes v1.compareTo (v2).
public  ObjectcopyDataStoreId(Object oid, ClassMetaData meta)
    
abstract public  ResultObjectProviderexecuteExtent(ClassMetaData meta, boolean subs, FetchConfiguration fetch)
     Create a ResultObjectProvider that can return all instances of type, optionally including subclasses as defined by subclasses. The implementation of the result provider will typically execute some sort of data store query to find all the applicable objects, loop through the results, extracting object IDs from the data, and invoke StoreContext.find(ObjectFetchConfigurationBitSetObjectint) on each OID.
public  Collectionflush(Collection sms)
     Breaks down states based on the objects' current states, and delegates to AbstractStoreManager.flush(Collection,Collection,Collection,Collection,Collection) .
abstract protected  Collectionflush(Collection pNew, Collection pNewUpdated, Collection pNewFlushedDeleted, Collection pDirty, Collection pDeleted)
     Responsible for writing modifications happened back to the data store.
public  ObjectgetClientConnection()
     Returns null.
public  StoreContextgetContext()
     Returns the StoreContext that this store manager is associated with.
public  SeqgetDataStoreIdSequence(ClassMetaData forClass)
     Returns the system-configured sequence.
public  ClassgetDataStoreIdType(ClassMetaData meta)
    
public  ClassgetManagedType(Object oid)
    
protected  StringgetPlatform()
     Returns a string name to identify the platform of this store manager.
protected  CollectiongetUnsupportedOptions()
     Returns a set of option names that this store manager does not support.
public  SeqgetValueSequence(FieldMetaData forField)
     Returns null.
abstract public  booleaninitialize(OpenJPAStateManager sm, PCState state, FetchConfiguration fetch, Object edata)
     This method is invoked when OpenJPA needs to load an object whose identity is known but which has not yet been loaded from the data store.
abstract public  booleanload(OpenJPAStateManager sm, BitSet fields, FetchConfiguration fetch, int lockLevel, Object edata)
     This method is invoked when OpenJPA needs to load additional data into an object that has already been at least partially loaded by a previous AbstractStoreManager.initialize invocation.
public  CollectionloadAll(Collection sms, PCState state, int load, FetchConfiguration fetch, Object edata)
     This implementation just delegates to the proper singular method ( StoreManager.initialize or StoreManager.load ) depending on each state manager's state.
protected  OpenJPAConfigurationnewConfiguration()
     Return a new configuration instance for this runtime.
public  ObjectnewDataStoreId(Object val, ClassMetaData meta)
    
public  FetchConfigurationnewFetchConfiguration()
    
public  StoreQuerynewQuery(String language)
    
protected  voidopen()
     No-op implementation.
public  voidreleaseConnection()
     Override to release previously-retained connection.
public  voidretainConnection()
     Override to retain a dedicated connection.
public  voidrollback()
     This is a no-op implementation.
public  voidrollbackOptimistic()
     No-op implementation.
final public  voidsetContext(StoreContext ctx)
    
public  booleansyncVersion(OpenJPAStateManager sm, Object edata)
     Since this store manager does not provide optimistic locking support, this method always returns true.

Field Detail
ctx
protected StoreContext ctx(Code)





Method Detail
assignDataStoreId
protected boolean assignDataStoreId(OpenJPAStateManager sm, Object val)(Code)
Assign a new datastore identity to the given instance. This given value may be null.



assignField
public boolean assignField(OpenJPAStateManager sm, int field, boolean preFlush)(Code)



assignObjectId
public boolean assignObjectId(OpenJPAStateManager sm, boolean preFlush)(Code)



beforeStateChange
public void beforeStateChange(OpenJPAStateManager sm, PCState fromState, PCState toState)(Code)



begin
public void begin()(Code)
OpenJPA assumes that after this method is invoked, all data accesses through this store manager will be part of a single unit of work that can be rolled back. This is a no-op implementation. If your data store does not support any concept of locking or transactions, you need not override this method.



beginOptimistic
public void beginOptimistic()(Code)
No-op implementation. Override this method to provide optimistic locking semantics for your data store if you need notification of the beginning of an optimistic transaction.



cancelAll
public boolean cancelAll()(Code)
Returns false. If your data store supports cancelling queries, this method should cancel any currently-running queries and return true if any were cancelled.



close
public void close()(Code)



commit
public void commit()(Code)
This is a no-op implementation. If your data store does not have a concept of transactions or a unit of work, you need not override this method. If it does, then override this method to notify the data store that the current transaction should be committed.



compareVersion
public int compareVersion(OpenJPAStateManager state, Object v1, Object v2)(Code)
Casts v1 and v2 to Comparable , and invokes v1.compareTo (v2). If v1 is less than v2, returns AbstractStoreManager.VERSION_EARLIER . If the same, returns AbstractStoreManager.VERSION_SAME . Otherwise, returns AbstractStoreManager.VERSION_LATER . If either v1 or v2 are null, returns AbstractStoreManager.VERSION_DIFFERENT .



copyDataStoreId
public Object copyDataStoreId(Object oid, ClassMetaData meta)(Code)



executeExtent
abstract public ResultObjectProvider executeExtent(ClassMetaData meta, boolean subs, FetchConfiguration fetch)(Code)
Create a ResultObjectProvider that can return all instances of type, optionally including subclasses as defined by subclasses. The implementation of the result provider will typically execute some sort of data store query to find all the applicable objects, loop through the results, extracting object IDs from the data, and invoke StoreContext.find(ObjectFetchConfigurationBitSetObjectint) on each OID. When invoking this method, the first argument is the OID. The second is the given fetch configuration. The third argument is a mask of fields to exclude from loading; it will typically be null. The fourth argument is an object that will be passed through to AbstractStoreManager.initialize or AbstractStoreManager.load , and typically will contain the actual data to load. For example, for a JDBC-based store manager, this might be the result set that is being iterated over. If this argument is null, then the AbstractStoreManager.initialize or AbstractStoreManager.load method will have to issue another command to the data store in order to fetch the data to be loaded.



flush
public Collection flush(Collection sms)(Code)
Breaks down states based on the objects' current states, and delegates to AbstractStoreManager.flush(Collection,Collection,Collection,Collection,Collection) .



flush
abstract protected Collection flush(Collection pNew, Collection pNewUpdated, Collection pNewFlushedDeleted, Collection pDirty, Collection pDeleted)(Code)
Responsible for writing modifications happened back to the data store. If you do not remove the OpenJPAConfiguration.OPTION_INC_FLUSH option in AbstractStoreManager.getUnsupportedOptions , this will be called only once at the end of a transaction. Otherwise, it may be called periodically throughout the course of a transaction. If this store manager supports optimistic transactions, datastore version information should be updated during flush, and the state manager's version indicator should be updated through the OpenJPAStateManager.setNextVersion method. This method will only be invoked if there are meaningful changes to store. This differs from the behavior of StoreManager.flush , which may be invoked with a collection of objects in states that do not require any datastore action (for example, objects in the transient-transactional state).
Parameters:
  pNew - Objects that should be added to the store,and that have not previously been flushed.
Parameters:
  pNewUpdated - New objects that have been modified sincethey were initially flushed. These werein persistentNew in an earlier flush invocation.
Parameters:
  pNewFlushedDeleted - New objects that have been deleted sincethey were initially flushed. These werein persistentNew in an earlier flush invocation.
Parameters:
  pDirty - Objects that were loaded from the datastore and have since been modified.
Parameters:
  pDeleted - Objects that were loaded from the datastore and have since been deleted. Thesemay have been in a previous flush invocation's persistentDirty list. a collection of exceptions encountered during flushing.



getClientConnection
public Object getClientConnection()(Code)
Returns null. If your data store can provide a distinct connection object, return it here.



getContext
public StoreContext getContext()(Code)
Returns the StoreContext that this store manager is associated with.



getDataStoreIdSequence
public Seq getDataStoreIdSequence(ClassMetaData forClass)(Code)
Returns the system-configured sequence. To use some other sort of datastore identifier (a GUID, string, or someting of that nature), override AbstractStoreManager.getManagedType , AbstractStoreManager.getDataStoreIdType , AbstractStoreManager.copyDataStoreId , AbstractStoreManager.newDataStoreId .



getDataStoreIdType
public Class getDataStoreIdType(ClassMetaData meta)(Code)



getManagedType
public Class getManagedType(Object oid)(Code)



getPlatform
protected String getPlatform()(Code)
Returns a string name to identify the platform of this store manager. Returns the class name of this store manager by default.



getUnsupportedOptions
protected Collection getUnsupportedOptions()(Code)
Returns a set of option names that this store manager does not support. By default, returns the following:



getValueSequence
public Seq getValueSequence(FieldMetaData forField)(Code)
Returns null.



initialize
abstract public boolean initialize(OpenJPAStateManager sm, PCState state, FetchConfiguration fetch, Object edata)(Code)
This method is invoked when OpenJPA needs to load an object whose identity is known but which has not yet been loaded from the data store. sm is a partially-set-up state manager for this object. The ID and least-derived type information for the instance to load can be obtained by invoking sm.getObjectId() and sm.getMetaData(). When implementing this method, load the data for this object from the data store, determine the most-derived subclass of the newly-loaded data, and then use the OpenJPAStateManager.initialize method to populate sm with a new instance of the appropriate type. Once OpenJPAStateManager.initialize has been invoked, proceed to load field data into sm as in the AbstractStoreManager.load method, by using OpenJPAStateManager.store (or the appropriate OpenJPAStateManager.storetype method) to put the data into the object.



load
abstract public boolean load(OpenJPAStateManager sm, BitSet fields, FetchConfiguration fetch, int lockLevel, Object edata)(Code)
This method is invoked when OpenJPA needs to load additional data into an object that has already been at least partially loaded by a previous AbstractStoreManager.initialize invocation. Load data into sm by using OpenJPAStateManager.store (or the appropriate OpenJPAStateManager.storetype method) to put the data into the object.



loadAll
public Collection loadAll(Collection sms, PCState state, int load, FetchConfiguration fetch, Object edata)(Code)
This implementation just delegates to the proper singular method ( StoreManager.initialize or StoreManager.load ) depending on each state manager's state. If your data store provides bulk loading APIs, overriding this method to be more clever may be advantageous.



newConfiguration
protected OpenJPAConfiguration newConfiguration()(Code)
Return a new configuration instance for this runtime. Configuration data is maintained at the factory level and is available to all OpenJPA components; therefore it is a good place to maintain shared resources such as connection pools, etc.



newDataStoreId
public Object newDataStoreId(Object val, ClassMetaData meta)(Code)



newFetchConfiguration
public FetchConfiguration newFetchConfiguration()(Code)



newQuery
public StoreQuery newQuery(String language)(Code)



open
protected void open()(Code)
No-op implementation. Ready this store manager for persistent operations.



releaseConnection
public void releaseConnection()(Code)
Override to release previously-retained connection.



retainConnection
public void retainConnection()(Code)
Override to retain a dedicated connection.



rollback
public void rollback()(Code)
This is a no-op implementation. If your data store does not have a concept of transactions or a unit of work, you need not override this method. If it does, then override this method to notify the data store that the current transaction should be rolled back.



rollbackOptimistic
public void rollbackOptimistic()(Code)
No-op implementation. Override this method to provide optimistic locking semantics for your data store if you need notification of a rollback of an optimistic transaction before AbstractStoreManager.begin is invoked.



setContext
final public void setContext(StoreContext ctx)(Code)



syncVersion
public boolean syncVersion(OpenJPAStateManager sm, Object edata)(Code)
Since this store manager does not provide optimistic locking support, this method always returns true.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

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