Java Doc for VersantPersistenceManager.java in  » Testing » PolePosition-0.20 » com » versant » core » 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 » Testing » PolePosition 0.20 » com.versant.core.jdo 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


com.versant.core.jdo.VersantPersistenceManager

All known Subclasses:   com.versant.core.ejb.EMProxy,  com.versant.core.jdo.PMProxy,  com.versant.core.jdo.VersantPersistenceManagerImp,
VersantPersistenceManager
public interface VersantPersistenceManager extends PersistenceManager(Code)
JDO Genie extension of the standard JDO PersistenceManager interface.


Field Summary
final public static  intEVENT_ALL
    
final public static  intEVENT_ERRORS
    
final public static  intEVENT_NORMAL
    
final public static  intEVENT_VERBOSE
    
final public static  intLOCKING_ALL
     Lock all objects in datastore tx (not fully supported on all db's).
final public static  intLOCKING_FIRST
     Lock only the first object navigated or fetched in datastore tx.
final public static  intLOCKING_NONE
     Do not lock any objects in datastore tx.
final public static  intPM_CACHE_REF_TYPE_SOFT
     Use soft references to instances in the local PM cache.
final public static  intPM_CACHE_REF_TYPE_STRONG
     Use strong references to instances in the local PM cache.
final public static  intPM_CACHE_REF_TYPE_WEAK
     Use weak references to instances in the local PM cache.


Method Summary
public  voidaddLifecycleListener(LifecycleListener listener, Class[] classes)
     This PersistenceManager method adds the listener to the list of lifecycle event listeners.
public  voidcancelQueryExecution()
     This will cancel the last exectuted query.
public  voidcheckModelConsistency()
     Check the consistency of all instances in the local cache.
public  voidevictAllFromL2CacheAfterCommit(Object[] a)
     Do VersantPersistenceManager.evictFromL2CacheAfterCommit(java.lang.Object) for each entry in the array.
public  voidevictAllFromL2CacheAfterCommit(Collection c)
     Do VersantPersistenceManager.evictFromL2CacheAfterCommit(java.lang.Object) for each entry in the collection.
public  voidevictAllFromL2CacheAfterCommit(Class cls, boolean includeSubclasses)
     Evict all information for all instances of a Class from the level 2 cache if the current transaction commits.
public  voidevictAllFromL2CacheAfterCommit()
     Evict all JDO instances from the level 2 cache if the current transaction commits.
public  voidevictFromL2CacheAfterCommit(Object o)
     Evict all information for an OID or persistent instance from the level 2 cache if the current transaction commits.
public  voidflush()
     This is typically used in operations where there is not enough memory available on the client to managed the transaction's dirty instances.

Flush all dirty and new instances to the database and evict all instances from the local cache.

public  voidflush(boolean retainValues)
     Flush all dirty and new instances to the database.

If retainValues is false then refer to VersantPersistenceManager.flush() .

If the PM is not currently associated with any JDBC connection (i.e.

public  StringgetConnectionDriverName(String dataStore)
     Obtain the driver name for the datastore.
public  StringgetConnectionURL(String dataStore)
     Obtain the URL for the datastore.
public  intgetDatastoreTxLocking()
     Get the locking mode for datastore transactions.
public  ConnectiongetJdbcConnection(String datastore)
     Obtain the JDBC connection associated with the PM for the datastore.
public  ObjectgetObjectByIDString(String value, boolean toValidate)
     Utility method to return an datastore identity instance by the String value that was returned from the id of the instance.
public  ObjectgetObjectByIDString(String value, boolean toValidate, boolean resolved)
    

This method returns an instance of any datastore identity class from the toString of its OID.

public  ObjectgetObjectByIdFromCache(Object oid)
     Return the instance for oid if it is present in the local PM cache otherwise return null.
public  intgetObjectsById(Object[] oids, int length, Object[] data, int stateFieldNo, int classMetaDataIndex)
     This util method is used by collection types to preload their pc entries.
public  ObjectgetOptimisticLockingValue(Object o)
     Return the Optimistic locking field value.
public  intgetPmCacheRefType()
     Get the type of reference used to reference new instances added to the local PM cache.
public  booleanhasIdentity(Object pc)
     Does the instance have an identity? New instances are only assigned an identity on commit or flush or when the application executes an operation that requires the identity.
public  booleanisCheckModelConsistencyOnCommit()
     Are instances in the local PM cache checked for consistency on commit? The default is false.
public  booleanisDirty()
    
public  booleanisHollow(Object pc)
     Is the instance hollow? Hollow instances are managed but their fields have not been loaded from the level 2 cache or database.
public  booleanisInterceptDfgFieldAccess()
     If this flag is true then access to default fetch group fields loaded into an instance is intercepted.
public  voidloadFetchGroup(Object pc, String name)
     Loads the fetch group fields for the already managed instance.
public  voidlogEvent(int level, String description, int ms)
     Log a user defined event.
public  voidmakeTransientRecursive(Object pc)
     This will recursively make all pc fields that is loaded transient.
public  ObjectnewObjectIdInstance(Class pcClass, String str, boolean resolved)
    

This method returns an OID instance for the given class and String. If the String is for a datastore identity class then the pcClass parameter may be null.

public  voidremoveLifecycleListener(LifecycleListener listener)
     This PersistenceManager method removes the listener from the list of event listeners.
public  voidsetCheckModelConsistencyOnCommit(boolean on)
     Enable or disable commit time consistency checking.
public  voidsetDatastoreTxLocking(int mode)
     Set the locking mode for datastore transactions.
public  voidsetInterceptDfgFieldAccess(boolean interceptDfgFieldAccess)
     Control the interception of access to default fetch group fields loaded into an instance.
public  voidsetPmCacheRefType(Object pc, int type)
     Change the type of reference to an instance in the local PM cache i.e.
public  voidsetPmCacheRefType(Object[] pcs, int type)
     Change the type of reference to an array of instances in the local PM cache i.e.
public  voidsetPmCacheRefType(Collection col, int type)
     Change the type of reference to a collection of instances in the local PM cache i.e.
public  voidsetPmCacheRefType(int type)
     Set the type of reference used to reference new instances added to the local PM cache.
public  voidsetRetainConnectionInOptTx(boolean on)
     If this is true then the datastore connection is retained throughout an optimistic tx even for JDBC databases.
public  ListversantAllDirtyInstances()
     This will return all the dirty instances in the current transaction.
public  CollectionversantAttachCopy(Collection detached, boolean makeTransactional)
     This method applies the changes contained in the collection of detached instances to the corresponding persistent instances in the cache and returns a collection of persistent instances that exactly corresponds to the parameter instances.
public  CollectionversantAttachCopy(Collection detached, boolean makeTransactional, boolean shallow)
     This method applies the changes contained in the collection of detached instances to the corresponding persistent instances in the cache and returns a collection of persistent instances that exactly corresponds to the parameter instances.
public  CollectionversantDetachCopy(Collection pcs, String fetchGroup)
     This method makes detached copies of the parameter instances and returns the copies as the result of the method.
public  QueryversantNewNamedQuery(Class cls, String queryName)
     Construct a new query instance with the given candidate class from a named query.

Field Detail
EVENT_ALL
final public static int EVENT_ALL(Code)



EVENT_ERRORS
final public static int EVENT_ERRORS(Code)



EVENT_NORMAL
final public static int EVENT_NORMAL(Code)



EVENT_VERBOSE
final public static int EVENT_VERBOSE(Code)



LOCKING_ALL
final public static int LOCKING_ALL(Code)
Lock all objects in datastore tx (not fully supported on all db's).



LOCKING_FIRST
final public static int LOCKING_FIRST(Code)
Lock only the first object navigated or fetched in datastore tx.



LOCKING_NONE
final public static int LOCKING_NONE(Code)
Do not lock any objects in datastore tx.



PM_CACHE_REF_TYPE_SOFT
final public static int PM_CACHE_REF_TYPE_SOFT(Code)
Use soft references to instances in the local PM cache. *



PM_CACHE_REF_TYPE_STRONG
final public static int PM_CACHE_REF_TYPE_STRONG(Code)
Use strong references to instances in the local PM cache. *



PM_CACHE_REF_TYPE_WEAK
final public static int PM_CACHE_REF_TYPE_WEAK(Code)
Use weak references to instances in the local PM cache. *





Method Detail
addLifecycleListener
public void addLifecycleListener(LifecycleListener listener, Class[] classes)(Code)
This PersistenceManager method adds the listener to the list of lifecycle event listeners. The classes parameter identifies all of the classes of interest. If the classes parameter is specified as null, events for all persistent classes and interfaces are generated. If the classes specified have persistence-capable subclasses, all such subclasses are registered implicitly. The listener will be called for each event for which it implements the corresponding listener interface.



cancelQueryExecution
public void cancelQueryExecution()(Code)
This will cancel the last exectuted query.



checkModelConsistency
public void checkModelConsistency()(Code)
Check the consistency of all instances in the local cache. Currently this makes sure that all birectional relationships have been completed properly (both sides in sync) but other checks may will be added in future. This method is very slow and should only be used for debugging during development.
See Also:   VersantPersistenceManager.setCheckModelConsistencyOnCommit(boolean)



evictAllFromL2CacheAfterCommit
public void evictAllFromL2CacheAfterCommit(Object[] a)(Code)
Do VersantPersistenceManager.evictFromL2CacheAfterCommit(java.lang.Object) for each entry in the array.
See Also:   VersantPersistenceManagerFactory.evictAll(java.lang.Object[])



evictAllFromL2CacheAfterCommit
public void evictAllFromL2CacheAfterCommit(Collection c)(Code)
Do VersantPersistenceManager.evictFromL2CacheAfterCommit(java.lang.Object) for each entry in the collection.
See Also:   VersantPersistenceManagerFactory.evictAll(java.util.Collection)



evictAllFromL2CacheAfterCommit
public void evictAllFromL2CacheAfterCommit(Class cls, boolean includeSubclasses)(Code)
Evict all information for all instances of a Class from the level 2 cache if the current transaction commits. If there is no active transaction the class(es) will be evicted after the next transaction that commits changes to the database.
Parameters:
  cls - Class to be evicted
Parameters:
  includeSubclasses - If true then instances of subclasses are alsoevicted
See Also:   VersantPersistenceManagerFactory.evictAll(java.lang.Classboolean)



evictAllFromL2CacheAfterCommit
public void evictAllFromL2CacheAfterCommit()(Code)
Evict all JDO instances from the level 2 cache if the current transaction commits. If there is no active transaction the cache is emptied immediately.



evictFromL2CacheAfterCommit
public void evictFromL2CacheAfterCommit(Object o)(Code)
Evict all information for an OID or persistent instance from the level 2 cache if the current transaction commits. If there is no active transaction the oid will be evicted after the next transaction that commits changes to the database. This is a NOP if there is no information in the cache for the OID or object or if the object is transient.
See Also:   VersantPersistenceManagerFactory.evict(java.lang.Object)



flush
public void flush()(Code)
This is typically used in operations where there is not enough memory available on the client to managed the transaction's dirty instances.

Flush all dirty and new instances to the database and evict all instances from the local cache. This allows unreferenced instances to be garbage collected making it easier to write loops that update millions of instances in a single transaction.


See Also:   VersantPersistenceManager.flush(boolean)
See Also:   VersantPersistenceManager.evictAll()




flush
public void flush(boolean retainValues)(Code)
Flush all dirty and new instances to the database.

If retainValues is false then refer to VersantPersistenceManager.flush() .

If the PM is not currently associated with any JDBC connection (i.e. it is using optimistic transactions) then the connection used to do the flush is pinned to the PM and used for all subsequent operations. This is very similar to a PM using datastore transactions.

This is used typically when you want to see the changes made in the pm when direct sql is used.
See Also:   VersantPersistenceManager.getJdbcConnection(java.lang.String)
See Also:   VersantPersistenceManager.flush()




getConnectionDriverName
public String getConnectionDriverName(String dataStore)(Code)
Obtain the driver name for the datastore. If the datastore name is null then the driver name for the default datastore is returned.



getConnectionURL
public String getConnectionURL(String dataStore)(Code)
Obtain the URL for the datastore. If the datastore name is null then the URL for the default datastore is returned.



getDatastoreTxLocking
public int getDatastoreTxLocking()(Code)
Get the locking mode for datastore transactions.



getJdbcConnection
public Connection getJdbcConnection(String datastore)(Code)
Obtain the JDBC connection associated with the PM for the datastore. If the datastore name is null then the connection for the default datastore is returned. If the PM is not currently associated with any connection (i.e. it is using optimistic transactions) then the connection returned is pinned to the PM and used for all subsequent operations. This is very similar to a PM using datastore transactions.

An exception is thrown if any transaction related methods are called on the connection (commit, rollback, setAutoCommit). The JDO API must be used for transaction control (pm.currentTransation().commit() etc.). The returned connection has autoCommit set to false and is a proxy for the real connection. This method may only be called inside a JDO transaction.

The connection is pinned to the PM until commit or rollback of the current JDO transaction. Once commit or rollback has been done it will be returned to the pool and the proxy is automatically closed. You can call close on the proxy but this does not close the underlying JDBC connection and it remains pinned to the PM.

If JDBC event logging is on then operations on the connection will be logged. This method is not available to remote clients and a JDOUserException is thrown if it is called by a remote client or if the datastore does not exist.


See Also:   VersantPersistenceManagerFactory.getJdbcConnection




getObjectByIDString
public Object getObjectByIDString(String value, boolean toValidate)(Code)
Utility method to return an datastore identity instance by the String value that was returned from the id of the instance. This avoids having to obtain the identity class for an Object and then via reflection creating an instance of the id and asking the pm for the pc instance by the id instance.



getObjectByIDString
public Object getObjectByIDString(String value, boolean toValidate, boolean resolved)(Code)

This method returns an instance of any datastore identity class from the toString of its OID. Calling this method with resolved true is equivalent to calling VersantPersistenceManager.getObjectByIDString(String,boolean) .

If resolved is false then the String may be for a superclass of the actual class. This is only possible if you have constructed the String yourself from the class ID of the base class and the primary key of the instance.


See Also:   VersantPersistenceManager.newObjectIdInstance(Class,String,boolean)



getObjectByIdFromCache
public Object getObjectByIdFromCache(Object oid)(Code)
Return the instance for oid if it is present in the local PM cache otherwise return null. Note that the instance might still be hollow and touching its fields will cause a fetch from the level 2 cache or database.
See Also:   VersantPersistenceManager.isHollow(Object)



getObjectsById
public int getObjectsById(Object[] oids, int length, Object[] data, int stateFieldNo, int classMetaDataIndex)(Code)
This util method is used by collection types to preload their pc entries. It tests to determine if the states refered to by the oids is in the managed cache. If not they must be bulk loaded from server. The scenario in which this is likely to happen is when the collection is not in the default fetch group and the state is in cache with the collection filled in. If this collection field is read then the pcstateman will determine that the stateField is filled and hence not ask the server for it.



getOptimisticLockingValue
public Object getOptimisticLockingValue(Object o)(Code)
Return the Optimistic locking field value. If the instance is persistent-new or if changedChecking is used then 'null' will be returned.



getPmCacheRefType
public int getPmCacheRefType()(Code)
Get the type of reference used to reference new instances added to the local PM cache.
See Also:   VersantPersistenceManager.PM_CACHE_REF_TYPE_WEAK
See Also:   VersantPersistenceManager.PM_CACHE_REF_TYPE_SOFT
See Also:   VersantPersistenceManager.PM_CACHE_REF_TYPE_STRONG



hasIdentity
public boolean hasIdentity(Object pc)(Code)
Does the instance have an identity? New instances are only assigned an identity on commit or flush or when the application executes an operation that requires the identity.



isCheckModelConsistencyOnCommit
public boolean isCheckModelConsistencyOnCommit()(Code)
Are instances in the local PM cache checked for consistency on commit? The default is false.
See Also:   VersantPersistenceManager.checkModelConsistency()
See Also:   VersantPersistenceManager.setCheckModelConsistencyOnCommit(boolean)
See Also:   VersantPersistenceManagerFactory.isCheckModelConsistencyOnCommit



isDirty
public boolean isDirty()(Code)
Does the current transaction contain any dirty instances?



isHollow
public boolean isHollow(Object pc)(Code)
Is the instance hollow? Hollow instances are managed but their fields have not been loaded from the level 2 cache or database.
See Also:   VersantPersistenceManager.getObjectByIdFromCache(Object)



isInterceptDfgFieldAccess
public boolean isInterceptDfgFieldAccess()(Code)
If this flag is true then access to default fetch group fields loaded into an instance is intercepted. See the "Cache Management" chapter of the manual for more information on this flag.



loadFetchGroup
public void loadFetchGroup(Object pc, String name)(Code)
Loads the fetch group fields for the already managed instance.
Parameters:
  pc - The PersistenceCapable instance for which to load the fields
Parameters:
  name - The name of the fetch group



logEvent
public void logEvent(int level, String description, int ms)(Code)
Log a user defined event. If the event logging level does not match the level parameter then the event is ignored. For remote PMs this check is done on the server so a network call is required even if the event is not logged.
See Also:   VersantPersistenceManager.EVENT_ERRORS
See Also:   VersantPersistenceManager.EVENT_NORMAL
See Also:   VersantPersistenceManager.EVENT_VERBOSE
See Also:   VersantPersistenceManager.EVENT_ALL



makeTransientRecursive
public void makeTransientRecursive(Object pc)(Code)
This will recursively make all pc fields that is loaded transient.



newObjectIdInstance
public Object newObjectIdInstance(Class pcClass, String str, boolean resolved)(Code)

This method returns an OID instance for the given class and String. If the String is for a datastore identity class then the pcClass parameter may be null. Calling this method with resolved true is equivalent to calling VersantPersistenceManager.newObjectIdInstance(Class,String) .

If resolved is false then the String may be for a superclass of the actual class. For datastore identity classes this is only possible if you have constructed the String yourself from the class ID of the base class and the primary key of the instance.


See Also:   VersantPersistenceManager.getObjectByIDString(String,boolean)



removeLifecycleListener
public void removeLifecycleListener(LifecycleListener listener)(Code)
This PersistenceManager method removes the listener from the list of event listeners.



setCheckModelConsistencyOnCommit
public void setCheckModelConsistencyOnCommit(boolean on)(Code)
Enable or disable commit time consistency checking. When this flag is enabled all instances in the local PM cache checked for consistency on commit. This check is expensive and should only be enabled during development.
See Also:   VersantPersistenceManager.checkModelConsistency()
See Also:   VersantPersistenceManagerFactory.setCheckModelConsistencyOnCommit(boolean)



setDatastoreTxLocking
public void setDatastoreTxLocking(int mode)(Code)
Set the locking mode for datastore transactions. You can set the default value for this property using the Workbench or edit your properties file directly (versant.datastoreTxLocking property). This method may be called at any time. If called inside a transaction it changes the mode for future SQL. The default setting is LOCKING_FIRST.
See Also:   VersantPersistenceManager.LOCKING_NONE
See Also:   VersantPersistenceManager.LOCKING_FIRST
See Also:   VersantPersistenceManager.LOCKING_ALL



setInterceptDfgFieldAccess
public void setInterceptDfgFieldAccess(boolean interceptDfgFieldAccess)(Code)
Control the interception of access to default fetch group fields loaded into an instance. See the "Cache Management" chapter of the manual for more information on this flag.



setPmCacheRefType
public void setPmCacheRefType(Object pc, int type)(Code)
Change the type of reference to an instance in the local PM cache i.e. an instance managed by this PM.
See Also:   VersantPersistenceManager.PM_CACHE_REF_TYPE_WEAK
See Also:   VersantPersistenceManager.PM_CACHE_REF_TYPE_SOFT
See Also:   VersantPersistenceManager.PM_CACHE_REF_TYPE_STRONG



setPmCacheRefType
public void setPmCacheRefType(Object[] pcs, int type)(Code)
Change the type of reference to an array of instances in the local PM cache i.e. an array of instances managed by this PM.
See Also:   VersantPersistenceManager.PM_CACHE_REF_TYPE_WEAK
See Also:   VersantPersistenceManager.PM_CACHE_REF_TYPE_SOFT
See Also:   VersantPersistenceManager.PM_CACHE_REF_TYPE_STRONG



setPmCacheRefType
public void setPmCacheRefType(Collection col, int type)(Code)
Change the type of reference to a collection of instances in the local PM cache i.e. an array of instances managed by this PM.
See Also:   VersantPersistenceManager.PM_CACHE_REF_TYPE_WEAK
See Also:   VersantPersistenceManager.PM_CACHE_REF_TYPE_SOFT
See Also:   VersantPersistenceManager.PM_CACHE_REF_TYPE_STRONG



setPmCacheRefType
public void setPmCacheRefType(int type)(Code)
Set the type of reference used to reference new instances added to the local PM cache.
See Also:   VersantPersistenceManager.PM_CACHE_REF_TYPE_WEAK
See Also:   VersantPersistenceManager.PM_CACHE_REF_TYPE_SOFT
See Also:   VersantPersistenceManager.PM_CACHE_REF_TYPE_STRONG



setRetainConnectionInOptTx
public void setRetainConnectionInOptTx(boolean on)(Code)
If this is true then the datastore connection is retained throughout an optimistic tx even for JDBC databases. Note that the datastore may ignore this flag (e.g. Versant which always retains the connection).



versantAllDirtyInstances
public List versantAllDirtyInstances()(Code)
This will return all the dirty instances in the current transaction. If there are no dirty instance then an empty list is returned.



versantAttachCopy
public Collection versantAttachCopy(Collection detached, boolean makeTransactional)(Code)
This method applies the changes contained in the collection of detached instances to the corresponding persistent instances in the cache and returns a collection of persistent instances that exactly corresponds to the parameter instances. The order of instances in the parameter Collection's iteration corresponds to the order of corresponding instances in the returned Collection's iteration.

Changes made to instances while detached are applied to the corresponding persistent instances in the cache. New instances associated with the detached instances are added to the persistent instances in the corresponding place.




versantAttachCopy
public Collection versantAttachCopy(Collection detached, boolean makeTransactional, boolean shallow)(Code)
This method applies the changes contained in the collection of detached instances to the corresponding persistent instances in the cache and returns a collection of persistent instances that exactly corresponds to the parameter instances. The order of instances in the parameter Collection's iteration corresponds to the order of corresponding instances in the returned Collection's iteration.

Changes made to instances while detached are applied to the corresponding persistent instances in the cache. New instances associated with the detached instances are added to the persistent instances in the corresponding place.
Parameters:
  detached - VersantDetachable objects to attach in the currenttransaction
Parameters:
  shallow - attach only the objects in 'detached' Collection and notreachable objects if true.




versantDetachCopy
public Collection versantDetachCopy(Collection pcs, String fetchGroup)(Code)
This method makes detached copies of the parameter instances and returns the copies as the result of the method. The order of instances in the parameter Collection's iteration corresponds to the order of corresponding instances in the returned Collection's iteration.

The Collection of instances is first made persistent, and the reachability algorithm is run on the instances. This ensures that the closure of all of the instances in the the parameter Collection is persistent.

For each instance in the parameter Collection, a corresponding detached copy is created. Each field in the persistent instance is handled based on its type and whether the field is contained in the fetch group for the persistence-capable class. If there are duplicates in the parameter Collection, the corresponding detached copy is used for each such duplicate.




versantNewNamedQuery
public Query versantNewNamedQuery(Class cls, String queryName)(Code)
Construct a new query instance with the given candidate class from a named query. The query name given must be the name of a query defined in metadata. The metadata is searched for the specified name. This is a JDO 2 preview feature.



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