Java Doc for StateManager.java in  » Database-ORM » JPOX » org » jpox » 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 » JPOX » org.jpox 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.jpox.StateManager

All known Subclasses:   org.jpox.state.AbstractStateManager,
StateManager
public interface StateManager (Code)
StateManager for JPOX persistent objects. Makes the assumption that a StateManager corresponds to ONE persistable object.
version:
   $Revision: 1.84 $


Field Summary
public static  intEMBEDDED_COLLECTION_ELEMENT_PC
    
public static  intEMBEDDED_MAP_KEY_PC
    
public static  intEMBEDDED_MAP_VALUE_PC
    
public static  intEMBEDDED_PC
    
public static  intPC
    


Method Summary
 voidaddEmbeddedOwner(StateManager ownerSM, int ownerFieldNumber)
     Method to register an owner StateManager with this embedded/serialised object.
 voidattach(boolean embedded)
     Method to attach the object managed by this StateManager.
 ObjectattachCopy(Object detachedPC, boolean embedded)
    
 voidchangeActivityState(ActivityState activityState, DatastoreClass table)
     Update the acitvity state.
 voidcheckInheritance(FieldValues fv)
     Look to the database to determine which class this object is.
 voidcheckManagedRelations()
     Method to process all managed relations for this object.
 voidclearFields()
     Method to clear all fields of the object.
 voidclearLoadedFlags()
     Method to clear all loaded flags on the object.
 voidclearManagedRelations()
     Method to clear any state related to "managed relationships" stored for the object. This removes all original values stored for bidirectional fields that were changed in the previous flush-cycle.
 voidclearNonPrimaryKeyFields()
     Method to clear all fields that are not part of the primary key of the object.
 voidclearSavedFields()
     Method to clear all saved fields on the object.
 voiddeletePersistent()
     Method to delete the object from persistence.
 voiddetach(FetchPlanState state)
     Method to detach the PersistenceCapable object.
 ObjectdetachCopy(FetchPlanState state)
    
 voiddisconnect()
     Disconnect the StateManager from the PersistenceManager and PC object.
 voiddump(PrintWriter out)
     Diagnostic method to dump the current state to the provided PrintWriter.
 voidenlistInTransaction()
    
 voidevict()
     Method to change the object state to evicted.
 voidevictFromTransaction()
    
 voidflush()
     Method to flush all changes to the datastore.
public  booleangetAllFieldsLoaded()
     Returns whether all fields are loaded.
 AbstractClassMetaDatagetClassMetaData()
     Accessor for the ClassMetaData for this object.
 String[]getDirtyFieldNames()
     Accessor for the names of all dirty fields.
public  int[]getDirtyFieldNumbers()
     Accessor for the field numbers of all dirty fields in this managed instance.
public  boolean[]getDirtyFields()
     Creates a copy of the internal dirtyFields array.
 StateManager[]getEmbeddedOwners()
     Accessor for the overall owner StateManagers of the managed object when embedded.
 ObjectgetExternalObjectId(Object obj)
    
 intgetHighestFieldNumber()
    
 ObjectgetInternalObjectId()
     Accessor for the id of the object managed by this StateManager.
 CachedPCgetL2CacheableObject()
     Accessor for an L2 cacheable form of this object.
 String[]getLoadedFieldNames()
     Accessor for the names of all loaded fields.
public  int[]getLoadedFieldNumbers()
     Accessor for the field numbers of all loaded fields in this managed instance.
 MetaDataManagergetMetaDataManager()
     Accessor for the manager for MetaData.
 ObjectgetObject()
     Accessor for the object managed by this StateManager.
 ObjectgetObjectId(PersistenceCapable pc)
     Accessor for the object id.
 ObjectManagergetObjectManager()
    
 intgetPcObjectType()
     Accessor for the PC object type.
 ObjectgetReferencedPC()
     Accessor for the referenced PC object when we are attaching or detaching.
 RelationshipManagergetRelationshipManager()
     Accessor for the relationship manager (if present).
 StoreManagergetStoreManager()
     Accessor for the manager for the store.
 ObjectgetTransactionalVersion(Object pc)
     Return the object representing the transactional version of the calling instance.
 ObjectgetValueForExternalField(JavaTypeMapping mapping)
     Accessor for the value of an external field.
 ObjectgetVersion(PersistenceCapable pc)
    
 voidinitialiseForCachedPC(Object pc, Object id, boolean loaded, Class pcClass)
     Initialise to create a StateManager for a PersistenceCapable object, assigning the specified id to the object.
 voidinitialiseForDetached(Object pc, Object id, Object version)
     Initialises the StateManager to manage a PersistenceCapable object in detached state.
 voidinitialiseForEmbedded(Object pc, boolean copyPc)
     Initialises a state manager to manage a PersistenceCapable instance that will be EMBEDDED/SERIALISED into another PersistenceCapable object.
 voidinitialiseForHollow(Object id, FieldValues fv, Class pcClass)
     Initialises a state manager to manage a hollow instance having the given object ID and the given (optional) field values.
 voidinitialiseForHollowAppId(FieldValues fv, Class pcClass)
     Initialises a state manager to manage a HOLLOW / P_CLEAN instance having the given FieldValues.
 voidinitialiseForHollowPreConstructed(Object id, Object pc)
     Initialises a state manager to manage the given hollow instance having the given object ID.
 voidinitialiseForPNewToBeDeleted(Object pc)
     Initialises the StateManager to manage a PersistenceCapable object that is not persistent but that is about to be deleted.
 voidinitialiseForPersistentClean(Object id, Object pc)
     Initialises a state manager to manage the passed persistent instance having the given object ID. Used where we have retrieved a PC object from a datastore directly (not field-by-field), for example on an object datastore.
 voidinitialiseForPersistentNew(Object pc, FieldValues preInsertChanges)
     Initialises a state manager to manage a transient instance that is becoming newly persistent.
 voidinitialiseForTransactionalTransient(Object pc)
     Initialises a state manager to manage a Transactional Transient instance.
 booleanisDeleted(PersistenceCapable pc)
     Accessor for whether the managed object is deleted.
 booleanisDeleting()
     Tests whether this object is in the process of being deleted.
public  booleanisDirty()
     Returns whether the object being managed is dirty.
 booleanisEmbedded()
     Convenience accessor for whether this StateManager manages an embedded/serialised object.
 booleanisInserted(int fieldNumber)
     Returns whether the specified field of this object is inserted in the datastore.
 booleanisInserted(String className)
     Returns whether this object is inserted in the datastore far enough to be considered of the supplied type.
 booleanisInserting()
     Tests whether this object is being inserted.
 booleanisLoaded(PersistenceCapable pc, int fieldNumber)
    
 booleanisNew(PersistenceCapable pc)
     Accessor for whether the managed object is new.
 booleanisRestoreValues()
    
 booleanisWaitingToBeFlushedToDatastore()
     Tests whether this object is new yet waiting to be flushed to the datastore.
 voidloadField(int fieldNumber)
     Convenience method to load the specified field if not loaded.
 voidloadFieldFromDatastore(int fieldNumber)
     Convenience method to load a field from the datastore.
 voidloadFieldValues(FieldValues fv)
     Convenience method to load the passed field values.
 voidloadFieldsInFetchPlan(FetchPlanState state)
     Method to load all unloaded fields in the FetchPlan.
 voidloadUnloadedFields()
     Fetch from the database all fields that are not currently loaded regardless of whether they are in the current fetch group or not.
 voidloadUnloadedFieldsInFetchPlan()
     Fetchs from the database all fields that are not currently loaded and that are in the current fetch group.
 voidloadUnloadedFieldsOfClassInFetchPlan(FetchPlan fetchPlan)
     Loads all unloaded fields of the managed class that are in the current FetchPlan.
 voidlocate()
     Locate this object in the datastore.
 voidmakeDirty(int fieldNumber)
     Method to mark the specified (absolute) field number as dirty.
 voidmakeNontransactional()
     Method to make the managed object nontransactional.
 voidmakePersistent()
     Method to make the managed object persistent.
 voidmakePersistentTransactionalTransient()
    
 voidmakeTransactional()
     Method to make the managed object transactional.
 voidmakeTransient(FetchPlanState state)
     Method to make the managed object transient.
 voidnullifyFields()
    
 voidpostCommit(Transaction tx)
     Convenience interceptor to allow operations to be performed after the commit is performed but before returning control to the application.
 voidpreBegin(Transaction tx)
    
 voidpreRollback(Transaction tx)
     Convenience interceptor to allow operations to be performed before any rollback is performed.
 voidprocessManagedRelations()
     Method to process all managed relations for this object.
 ObjectprovideField(int fieldNumber)
     Method to return the current value of the specified field.
 voidprovideFields(int fieldNumbers, FieldManager fm)
     Method to obtain updated field values from the passed FieldManager.
 voidrefresh()
     Method to refresh the values of the currently loaded fields in the managed object.
 voidrefreshFieldsInFetchPlan()
     Refreshes from the database all fields in fetch plan.
 voidrefreshLoadedFields()
     Refreshes from the database all fields currently loaded.
 voidregisterTransactional()
    
 voidreplaceAllLoadedSCOFieldsWithValues()
     Method to replace all loaded (wrapped) SCO fields with unwrapped values.
 voidreplaceAllLoadedSCOFieldsWithWrappers()
     Method to replace all loaded SCO fields with wrappers.
 voidreplaceField(int fieldNumber, Object value, boolean makeDirty)
     Method to change the value of the specified field.
 voidreplaceFieldValue(int fieldNumber, Object newValue)
     Convenience method to change the value of a field that is assumed loaded.
 voidreplaceFields(int fieldNumbers, FieldManager fm, boolean replaceWhenDirty)
    
 voidreplaceFields(int fieldNumbers, FieldManager fm)
    
 voidreplaceManagedPC(PersistenceCapable pc)
     Method to swap the managed object for the supplied object. This is of particular use for object datastores where the datastore is responsible for creating the in-memory object and where we have a temporary object that we want to swap for the datastore generated object.
 voidreplaceNonLoadedFields(int fieldNumbers, FieldManager fm)
     Method to update the data in the object with the values from the passed FieldManager.
 voidresetDetachState()
     Convenience method to reset the detached state in the current object.
 voidrestoreFields()
     Method to restore all fields of the object.
 voidretrieve(boolean fgOnly)
     Method to retrieve the fields for this object.
 voidretrieve(FetchPlan fetchPlan)
     Method to retrieve the object.
 voidretrieveDetachState(org.jpox.StateManager sm)
    
 voidrunReachability(Set reachables)
     Method to run reachability from this StateManager.
 voidsaveFields()
     Method to save all fields of the object.
 voidsetExternalFieldValueForMapping(JavaTypeMapping mapping, Object value)
    
 voidsetObjectField(PersistenceCapable pc, int fieldNumber, Object oldValue, Object newValue)
    
 voidsetPcObjectType(int embeddedType)
     Method to set this StateManager as managing an embedded/serialised object.
 voidsetPostStoreNewObjectId(Object id)
     Method to allow the setting of the id of the PC object.
 voidsetStoringPC()
     Method to set the storing PC flag.
 voidsetTransactionalVersion(Object optimisticTransactionalVersion)
    
 voidsetVersion(Object version)
     Sets the value for the version column in the datastore.
 voidunloadField(String fieldName)
     Mark the specified field as not loaded so that it will be reloaded on next access.
 voidunloadNonFetchPlanFields()
     Method that will unload all fields that are not in the FetchPlan.
 voidunsetStoringPC()
     Method to unset the storing PC flag.
 ObjectunwrapSCOField(int fieldNumber, Object value, boolean replaceFieldIfChanged)
     Method to unwrap a SCO field (if it is wrapped currently) and return the unwrapped value.
 voidupdateFieldAfterInsert(Object pc, int fieldNumber)
     Marks the given field dirty for issuing an update after the insert.
Parameters:
  pc - The Persistable object
Parameters:
  fieldNumber - The no of field to mark as dirty.
 voidvalidate()
     Validates whether the persistence capable instance exists in the datastore.
 ObjectwrapSCOField(int fieldNumber, Object value, boolean forInsert, boolean forUpdate, boolean replaceFieldIfChanged)
     Method to wrap a SCO field (if not wrapped currently) and return the wrapped value.

Field Detail
EMBEDDED_COLLECTION_ELEMENT_PC
public static int EMBEDDED_COLLECTION_ELEMENT_PC(Code)
Embedded (or serialised) Collection Element PC *



EMBEDDED_MAP_KEY_PC
public static int EMBEDDED_MAP_KEY_PC(Code)
Embedded (or serialised) Map Key PC *



EMBEDDED_MAP_VALUE_PC
public static int EMBEDDED_MAP_VALUE_PC(Code)
Embedded (or serialised) Map Value PC *



EMBEDDED_PC
public static int EMBEDDED_PC(Code)
Embedded (or serialised) PC *



PC
public static int PC(Code)
PC *





Method Detail
addEmbeddedOwner
void addEmbeddedOwner(StateManager ownerSM, int ownerFieldNumber)(Code)
Method to register an owner StateManager with this embedded/serialised object.
Parameters:
  ownerSM - The owning State Manager.
Parameters:
  ownerFieldNumber - The field number in the owner that the embedded/serialised object is stored as



attach
void attach(boolean embedded)(Code)
Method to attach the object managed by this StateManager.
Parameters:
  embedded - Whether it is embedded
since:
   1.2



attachCopy
Object attachCopy(Object detachedPC, boolean embedded)(Code)
Method to attach to this the detached persistable instance
Parameters:
  detachedPC - the detached persistable instance to be attached
Parameters:
  embedded - Whether it is embedded The attached copy
since:
   1.1



changeActivityState
void changeActivityState(ActivityState activityState, DatastoreClass table)(Code)
Update the acitvity state.
Parameters:
  activityState - the activity state
Parameters:
  table - Datastore class that has just been processed



checkInheritance
void checkInheritance(FieldValues fv)(Code)
Look to the database to determine which class this object is. This parameter is a hint. Set false, if it's already determined the correct pcClass for this pc "object" in a certain level in the hierarchy. Set to true and it will look to the database.
Parameters:
  fv - the initial field values of the object.



checkManagedRelations
void checkManagedRelations()(Code)
Method to process all managed relations for this object.



clearFields
void clearFields()(Code)
Method to clear all fields of the object.



clearLoadedFlags
void clearLoadedFlags()(Code)
Method to clear all loaded flags on the object.



clearManagedRelations
void clearManagedRelations()(Code)
Method to clear any state related to "managed relationships" stored for the object. This removes all original values stored for bidirectional fields that were changed in the previous flush-cycle. This is called when ObjectManager.flush() completes.



clearNonPrimaryKeyFields
void clearNonPrimaryKeyFields()(Code)
Method to clear all fields that are not part of the primary key of the object.



clearSavedFields
void clearSavedFields()(Code)
Method to clear all saved fields on the object.



deletePersistent
void deletePersistent()(Code)
Method to delete the object from persistence.



detach
void detach(FetchPlanState state)(Code)
Method to detach the PersistenceCapable object.
Parameters:
  state - State for the detachment process



detachCopy
Object detachCopy(FetchPlanState state)(Code)
Method to make detached copy of this instance
Parameters:
  state - State for the detachment process the detached PersistenceCapable instance
since:
   1.1



disconnect
void disconnect()(Code)
Disconnect the StateManager from the PersistenceManager and PC object.



dump
void dump(PrintWriter out)(Code)
Diagnostic method to dump the current state to the provided PrintWriter.
Parameters:
  out - The PrintWriter



enlistInTransaction
void enlistInTransaction()(Code)



evict
void evict()(Code)
Method to change the object state to evicted.



evictFromTransaction
void evictFromTransaction()(Code)



flush
void flush()(Code)
Method to flush all changes to the datastore.



getAllFieldsLoaded
public boolean getAllFieldsLoaded()(Code)
Returns whether all fields are loaded. Returns true if all fields are loaded.



getClassMetaData
AbstractClassMetaData getClassMetaData()(Code)
Accessor for the ClassMetaData for this object. The ClassMetaData.



getDirtyFieldNames
String[] getDirtyFieldNames()(Code)
Accessor for the names of all dirty fields. Names of all dirty fields



getDirtyFieldNumbers
public int[] getDirtyFieldNumbers()(Code)
Accessor for the field numbers of all dirty fields in this managed instance. Field numbers of all (currently) dirty fields



getDirtyFields
public boolean[] getDirtyFields()(Code)
Creates a copy of the internal dirtyFields array. TODO Change this to return an array of the field numbers that are dirty a copy of the internal dirtyFields array.



getEmbeddedOwners
StateManager[] getEmbeddedOwners()(Code)
Accessor for the overall owner StateManagers of the managed object when embedded. Owning StateManagers when embedded (if any)



getExternalObjectId
Object getExternalObjectId(Object obj)(Code)
return a copy from the object Id
Parameters:
  obj - the persistable object the object id



getHighestFieldNumber
int getHighestFieldNumber()(Code)
Accessor for the highest field number Highest field number



getInternalObjectId
Object getInternalObjectId()(Code)
Accessor for the id of the object managed by this StateManager. The identity of the object



getL2CacheableObject
CachedPC getL2CacheableObject()(Code)
Accessor for an L2 cacheable form of this object. The L2 cacheable object



getLoadedFieldNames
String[] getLoadedFieldNames()(Code)
Accessor for the names of all loaded fields. Names of all loaded fields



getLoadedFieldNumbers
public int[] getLoadedFieldNumbers()(Code)
Accessor for the field numbers of all loaded fields in this managed instance. Field numbers of all (currently) loaded fields



getMetaDataManager
MetaDataManager getMetaDataManager()(Code)
Accessor for the manager for MetaData. MetaData manager



getObject
Object getObject()(Code)
Accessor for the object managed by this StateManager. The object



getObjectId
Object getObjectId(PersistenceCapable pc)(Code)
Accessor for the object id.
Parameters:
  pc - The PC object The (external) id



getObjectManager
ObjectManager getObjectManager()(Code)
Returns the ObjectManager that owns the StateManager instance The ObjectManager



getPcObjectType
int getPcObjectType()(Code)
Accessor for the PC object type. PC Object type (PC, embedded PC, etc)



getReferencedPC
Object getReferencedPC()(Code)
Accessor for the referenced PC object when we are attaching or detaching. When attaching and this is the detached object this returns the newly attached object. When attaching and this is the newly attached object this returns the detached object. When detaching and this is the newly detached object this returns the attached object. When detaching and this is the attached object this returns the newly detached object. The referenced object (or null).



getRelationshipManager
RelationshipManager getRelationshipManager()(Code)
Accessor for the relationship manager (if present). The Relationship manager



getStoreManager
StoreManager getStoreManager()(Code)
Accessor for the manager for the store. Store Manager



getTransactionalVersion
Object getTransactionalVersion(Object pc)(Code)
Return the object representing the transactional version of the calling instance.
Parameters:
  pc - the calling persistable instance the object representing the version of the calling instance
since:
   1.1.1



getValueForExternalField
Object getValueForExternalField(JavaTypeMapping mapping)(Code)
Accessor for the value of an external field. This is used when inserting this object so that we can insert the external field values too.
Parameters:
  mapping - The external field mapping The value for this mapping



getVersion
Object getVersion(PersistenceCapable pc)(Code)



initialiseForCachedPC
void initialiseForCachedPC(Object pc, Object id, boolean loaded, Class pcClass)(Code)
Initialise to create a StateManager for a PersistenceCapable object, assigning the specified id to the object. This is used when getting objects out of the L2 Cache, where they have no StateManager assigned, and returning them as associated with a particular PM.
Parameters:
  pc - The PersistenceCapable object
Parameters:
  id - Id to assign to the PersistenceCapable object
Parameters:
  loaded - The list of loaded fields (when put in the cache)
Parameters:
  pcClass - Class of the object that this will manage the state for



initialiseForDetached
void initialiseForDetached(Object pc, Object id, Object version)(Code)
Initialises the StateManager to manage a PersistenceCapable object in detached state.
Parameters:
  pc - the detach object.
Parameters:
  id - the identity of the object.
Parameters:
  version - the detached version
since:
   1.1



initialiseForEmbedded
void initialiseForEmbedded(Object pc, boolean copyPc)(Code)
Initialises a state manager to manage a PersistenceCapable instance that will be EMBEDDED/SERIALISED into another PersistenceCapable object. The instance will not be assigned an identity in the process since it is a SCO.
Parameters:
  pc - The PersistenceCapable to manage (see copyPc also)
Parameters:
  copyPc - Whether the SM should manage a copy of the passed PC or that one



initialiseForHollow
void initialiseForHollow(Object id, FieldValues fv, Class pcClass)(Code)
Initialises a state manager to manage a hollow instance having the given object ID and the given (optional) field values. This constructor is used for creating new instances of existing persistent objects, and consequently shouldnt be used when the StoreManager controls the creation of such objects (such as in an ODBMS).
Parameters:
  id - the identity of the object.
Parameters:
  fv - the initial field values of the object (optional)
Parameters:
  pcClass - Class of the object that this will manage the state for



initialiseForHollowAppId
void initialiseForHollowAppId(FieldValues fv, Class pcClass)(Code)
Initialises a state manager to manage a HOLLOW / P_CLEAN instance having the given FieldValues. This constructor is used for creating new instances of existing persistent objects using application identity, and consequently shouldnt be used when the StoreManager controls the creation of such objects (such as in an ODBMS).
Parameters:
  fv - the initial field values of the object.
Parameters:
  pcClass - Class of the object that this will manage the state for



initialiseForHollowPreConstructed
void initialiseForHollowPreConstructed(Object id, Object pc)(Code)
Initialises a state manager to manage the given hollow instance having the given object ID. Unlike the StateManager.initialiseForHollow method, this method does not create a new instance and instead takes a pre-constructed instance.
Parameters:
  id - the identity of the object.
Parameters:
  pc - the object to be managed.



initialiseForPNewToBeDeleted
void initialiseForPNewToBeDeleted(Object pc)(Code)
Initialises the StateManager to manage a PersistenceCapable object that is not persistent but that is about to be deleted. The initial state will be P_NEW, but when the delete call comes in will be P_NEW_DELETED. The object will not be enlisted in the transaction.
Parameters:
  pc - the object to delete
since:
   1.2



initialiseForPersistentClean
void initialiseForPersistentClean(Object id, Object pc)(Code)
Initialises a state manager to manage the passed persistent instance having the given object ID. Used where we have retrieved a PC object from a datastore directly (not field-by-field), for example on an object datastore. This initialiser will not add StateManagers to all related PCs. This must be done by any calling process. This simply adds the StateManager to the specified object and records the id, setting all fields of the object as loaded.
Parameters:
  id - the identity of the object.
Parameters:
  pc - The object to be managed



initialiseForPersistentNew
void initialiseForPersistentNew(Object pc, FieldValues preInsertChanges)(Code)
Initialises a state manager to manage a transient instance that is becoming newly persistent. A new object ID for the instance is obtained from the store manager and the object is inserted in the data store.

This constructor is used for assigning state managers to existing instances that are transitioning to a persistent state.
Parameters:
  pc - the instance being make persistent.
Parameters:
  preInsertChanges - Any changes to make before inserting




initialiseForTransactionalTransient
void initialiseForTransactionalTransient(Object pc)(Code)
Initialises a state manager to manage a Transactional Transient instance. A new object ID for the instance is obtained from the store manager and the object is inserted in the data store.

This constructor is used for assigning state managers to Transient instances that are transitioning to a transient clean state.
Parameters:
  pc - the instance being make persistent.




isDeleted
boolean isDeleted(PersistenceCapable pc)(Code)
Accessor for whether the managed object is deleted.
Parameters:
  pc - The PC object Whether it is deleted



isDeleting
boolean isDeleting()(Code)
Tests whether this object is in the process of being deleted. true if this instance is being deleted.



isDirty
public boolean isDirty()(Code)
Returns whether the object being managed is dirty. whether at least one field is dirty by checking the dirty flag.



isEmbedded
boolean isEmbedded()(Code)
Convenience accessor for whether this StateManager manages an embedded/serialised object. Whether the managed object is embedded/serialised.



isInserted
boolean isInserted(int fieldNumber)(Code)
Returns whether the specified field of this object is inserted in the datastore. Only applies during the makePersistent process.
Parameters:
  fieldNumber - Number of the field Whether it is inserted to the level of this field



isInserted
boolean isInserted(String className)(Code)
Returns whether this object is inserted in the datastore far enough to be considered of the supplied type. For example if we have base class A, B extends A and this object is a B, and we pass in A here then this returns whether the A part of the object is now inserted.
Parameters:
  className - Name of class that we want to check the insertion level for. Whether the object is inserted in the datastore to this level



isInserting
boolean isInserting()(Code)
Tests whether this object is being inserted. true if this instance is inserting.



isLoaded
boolean isLoaded(PersistenceCapable pc, int fieldNumber)(Code)



isNew
boolean isNew(PersistenceCapable pc)(Code)
Accessor for whether the managed object is new.
Parameters:
  pc - The PC object Whether it is new



isRestoreValues
boolean isRestoreValues()(Code)
Accessor for the Restore Values flag Whether to restore values



isWaitingToBeFlushedToDatastore
boolean isWaitingToBeFlushedToDatastore()(Code)
Tests whether this object is new yet waiting to be flushed to the datastore. true if this instance is waiting to be flushed



loadField
void loadField(int fieldNumber)(Code)
Convenience method to load the specified field if not loaded.
Parameters:
  fieldNumber - Absolute field number



loadFieldFromDatastore
void loadFieldFromDatastore(int fieldNumber)(Code)
Convenience method to load a field from the datastore. Used in attaching fields and checking their old values (so we dont want any postLoad method being called). TODO Merge this with one of the loadXXXFields methods.
Parameters:
  fieldNumber - The field number.



loadFieldValues
void loadFieldValues(FieldValues fv)(Code)
Convenience method to load the passed field values. Loads the fields using any required fetch plan and calls jdoPostLoad() as appropriate.
Parameters:
  fv - Field Values to load (including any fetch plan to use when loading)



loadFieldsInFetchPlan
void loadFieldsInFetchPlan(FetchPlanState state)(Code)
Method to load all unloaded fields in the FetchPlan. Recurses through the FetchPlan objects and loads fields of sub-objects where needed.
Parameters:
  state - The FetchPlan state



loadUnloadedFields
void loadUnloadedFields()(Code)
Fetch from the database all fields that are not currently loaded regardless of whether they are in the current fetch group or not. Called by lifecycle transitions.
since:
   1.1



loadUnloadedFieldsInFetchPlan
void loadUnloadedFieldsInFetchPlan()(Code)
Fetchs from the database all fields that are not currently loaded and that are in the current fetch group. Called by lifecycle transitions.
since:
   1.1



loadUnloadedFieldsOfClassInFetchPlan
void loadUnloadedFieldsOfClassInFetchPlan(FetchPlan fetchPlan)(Code)
Loads all unloaded fields of the managed class that are in the current FetchPlan. Called by life-cycle transitions.
Parameters:
  fetchPlan - The FetchPlan
since:
   1.1



locate
void locate()(Code)
Locate this object in the datastore.
throws:
  JPOXObjectNotFoundException - if the object doesnt exist.



makeDirty
void makeDirty(int fieldNumber)(Code)
Method to mark the specified (absolute) field number as dirty.
Parameters:
  fieldNumber - The (absolute) field number of the field



makeNontransactional
void makeNontransactional()(Code)
Method to make the managed object nontransactional.



makePersistent
void makePersistent()(Code)
Method to make the managed object persistent.



makePersistentTransactionalTransient
void makePersistentTransactionalTransient()(Code)
Method to make Transactional Transient instances persistent



makeTransactional
void makeTransactional()(Code)
Method to make the managed object transactional.



makeTransient
void makeTransient(FetchPlanState state)(Code)
Method to make the managed object transient.
Parameters:
  state - Object containing the state of any fetch plan processing



nullifyFields
void nullifyFields()(Code)
Nullify fields with reference to PersistenceCapable or SCO instances



postCommit
void postCommit(Transaction tx)(Code)
Convenience interceptor to allow operations to be performed after the commit is performed but before returning control to the application.
Parameters:
  tx - The transaction



preBegin
void preBegin(Transaction tx)(Code)
Convenience interceptor to allow operations to be performed before the begin is performed
Parameters:
  tx - The transaction



preRollback
void preRollback(Transaction tx)(Code)
Convenience interceptor to allow operations to be performed before any rollback is performed.
Parameters:
  tx - The transaction



processManagedRelations
void processManagedRelations()(Code)
Method to process all managed relations for this object.



provideField
Object provideField(int fieldNumber)(Code)
Method to return the current value of the specified field.
Parameters:
  fieldNumber - (absolute) field number of the field The current value



provideFields
void provideFields(int fieldNumbers, FieldManager fm)(Code)
Method to obtain updated field values from the passed FieldManager.
Parameters:
  fieldNumbers - The numbers of the fields
Parameters:
  fm - The fieldManager



refresh
void refresh()(Code)
Method to refresh the values of the currently loaded fields in the managed object.



refreshFieldsInFetchPlan
void refreshFieldsInFetchPlan()(Code)
Refreshes from the database all fields in fetch plan. Called by life-cycle transitions.



refreshLoadedFields
void refreshLoadedFields()(Code)
Refreshes from the database all fields currently loaded. Called by life-cycle transitions.



registerTransactional
void registerTransactional()(Code)
Registers the pc class in the cache



replaceAllLoadedSCOFieldsWithValues
void replaceAllLoadedSCOFieldsWithValues()(Code)
Method to replace all loaded (wrapped) SCO fields with unwrapped values. If the loaded field doesnt use a SCO wrapper nothing happens to that field.



replaceAllLoadedSCOFieldsWithWrappers
void replaceAllLoadedSCOFieldsWithWrappers()(Code)
Method to replace all loaded SCO fields with wrappers. If the loaded field already uses a SCO wrapper nothing happens to that field.



replaceField
void replaceField(int fieldNumber, Object value, boolean makeDirty)(Code)
Method to change the value of the specified field.
Parameters:
  fieldNumber - (absolute) field number of the field
Parameters:
  value - The new value.
Parameters:
  makeDirty - Whether to make the field dirty when replacing it



replaceFieldValue
void replaceFieldValue(int fieldNumber, Object newValue)(Code)
Convenience method to change the value of a field that is assumed loaded. Will mark the object/field as dirty if it isnt previously. Only for use in management of relations.
Parameters:
  fieldNumber - Number of field
Parameters:
  newValue - The new value



replaceFields
void replaceFields(int fieldNumbers, FieldManager fm, boolean replaceWhenDirty)(Code)
Method to update the data in the object with the values from the passed FieldManager
Parameters:
  fieldNumbers - (absolute) field numbers of the fields to update
Parameters:
  fm - The FieldManager
Parameters:
  replaceWhenDirty - Whether to replace these fields if the field is dirty



replaceFields
void replaceFields(int fieldNumbers, FieldManager fm)(Code)
Method to update the data in the object with the values from the passed FieldManager
Parameters:
  fieldNumbers - (absolute) field numbers of the fields to update
Parameters:
  fm - The FieldManager



replaceManagedPC
void replaceManagedPC(PersistenceCapable pc)(Code)
Method to swap the managed object for the supplied object. This is of particular use for object datastores where the datastore is responsible for creating the in-memory object and where we have a temporary object that we want to swap for the datastore generated object. Makes no change to what fields are loaded/dirty etc, just swaps the managed object.
Parameters:
  pc - The PersistenceCapable to use



replaceNonLoadedFields
void replaceNonLoadedFields(int fieldNumbers, FieldManager fm)(Code)
Method to update the data in the object with the values from the passed FieldManager. Only non loaded fields are updated
Parameters:
  fieldNumbers - (absolute) field numbers of the fields to update
Parameters:
  fm - The FieldManager



resetDetachState
void resetDetachState()(Code)
Convenience method to reset the detached state in the current object.



restoreFields
void restoreFields()(Code)
Method to restore all fields of the object.



retrieve
void retrieve(boolean fgOnly)(Code)
Method to retrieve the fields for this object.
Parameters:
  fgOnly - Whether to retrieve just the current fetch plan fields



retrieve
void retrieve(FetchPlan fetchPlan)(Code)
Method to retrieve the object.
Parameters:
  fetchPlan - the fetch plan to load fields



retrieveDetachState
void retrieveDetachState(org.jpox.StateManager sm)(Code)
Convenience method to retrieve the detach state from the passed State Manager's object
Parameters:
  sm - The State Manager



runReachability
void runReachability(Set reachables)(Code)
Method to run reachability from this StateManager.
Parameters:
  reachables - List of reachable StateManagers so far



saveFields
void saveFields()(Code)
Method to save all fields of the object.



setExternalFieldValueForMapping
void setExternalFieldValueForMapping(JavaTypeMapping mapping, Object value)(Code)
Method to set the value for an external field stored against this object
Parameters:
  mapping - The mapping for the (external) field
Parameters:
  value - The value that this field has



setObjectField
void setObjectField(PersistenceCapable pc, int fieldNumber, Object oldValue, Object newValue)(Code)



setPcObjectType
void setPcObjectType(int embeddedType)(Code)
Method to set this StateManager as managing an embedded/serialised object.
Parameters:
  embeddedType - The type of object being managed



setPostStoreNewObjectId
void setPostStoreNewObjectId(Object id)(Code)
Method to allow the setting of the id of the PC object. This is used when it is obtained after persisting the object to the datastore. In the case of RDBMS, this may be via auto-increment, or in the case of ODBMS this may be an accessor for the id after storing.
Parameters:
  id - the id received from the datastore. May be an OID, or the key value for an OID, or an application id.



setStoringPC
void setStoringPC()(Code)
Method to set the storing PC flag.



setTransactionalVersion
void setTransactionalVersion(Object optimisticTransactionalVersion)(Code)
Sets the value for the version column in a transaction not yet committed
Parameters:
  optimisticTransactionalVersion -



setVersion
void setVersion(Object version)(Code)
Sets the value for the version column in the datastore. Update the transactional version too
Parameters:
  version - The version



unloadField
void unloadField(String fieldName)(Code)
Mark the specified field as not loaded so that it will be reloaded on next access.
Parameters:
  fieldName - Name of the field



unloadNonFetchPlanFields
void unloadNonFetchPlanFields()(Code)
Method that will unload all fields that are not in the FetchPlan.
since:
   1.2



unsetStoringPC
void unsetStoringPC()(Code)
Method to unset the storing PC flag.



unwrapSCOField
Object unwrapSCOField(int fieldNumber, Object value, boolean replaceFieldIfChanged)(Code)
Method to unwrap a SCO field (if it is wrapped currently) and return the unwrapped value. If the field is not a SCO field will just return the value. If "replaceFieldIfChanged" is set, we replace the value in the object with the unwrapped value.
Parameters:
  fieldNumber - The field number
Parameters:
  value - The value to unwrap for this field
Parameters:
  replaceFieldIfChanged - Whether to replace the field value in the object if unwrapping the value The unwrapped field value



updateFieldAfterInsert
void updateFieldAfterInsert(Object pc, int fieldNumber)(Code)
Marks the given field dirty for issuing an update after the insert.
Parameters:
  pc - The Persistable object
Parameters:
  fieldNumber - The no of field to mark as dirty.



validate
void validate()(Code)
Validates whether the persistence capable instance exists in the datastore. If the instance does not exist in the datastore, this method will fail raising a JPOXObjectNotFoundException.



wrapSCOField
Object wrapSCOField(int fieldNumber, Object value, boolean forInsert, boolean forUpdate, boolean replaceFieldIfChanged)(Code)
Method to wrap a SCO field (if not wrapped currently) and return the wrapped value. If the field is not a SCO field will just return the value. If "replaceFieldIfChanged" is set, we replace the value in the object with the wrapped value.
Parameters:
  fieldNumber - Number of the field
Parameters:
  value - The value to give it
Parameters:
  forInsert - Whether the creation of any wrapper should insert this value into the datastore
Parameters:
  forUpdate - Whether the creation of any wrapper should update the datastore with this value
Parameters:
  replaceFieldIfChanged - Whether to replace the field in the object if wrapping the value The wrapper (or original value if not wrappable)



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