wt.fc
Class StandardPersistenceManager

java.lang.Object
  extended bywt.services.StandardManager
      extended bywt.fc.StandardPersistenceManager
All Implemented Interfaces:
Manager, NetFactor, PersistenceManager, PersistenceManagerSvr, Serializable

public class StandardPersistenceManager
extends StandardManager
implements PersistenceManager, PersistenceManagerSvr, Serializable

StandardPersistenceManager is a concrete persistent manager targeted for WTObject classes.

Use the newStandardPersistenceManager static factory method(s), not the StandardPersistenceManager constructor, to construct instances of this class. Instances must be constructed using the static factory(s), in order to ensure proper initialization of the instance.



Supported API: true

Extendable: false

See Also:
Serialized Form

Nested Class Summary
(package private) static class StandardPersistenceManager.AbstractInsertUpdateProcessor
           
private  class StandardPersistenceManager.AllManagersStartedEventListener
           
(package private)  class StandardPersistenceManager.PagingSessionEventListener
           
private static class StandardPersistenceManager.PersistInfoData
           
private static class StandardPersistenceManager.ReferentialIntegrityValidator
           
 
Field Summary
private static int CHECK_DELETE
           
private static int CHECK_MODIFY
           
private static int CHECK_STORE
           
private static String CLASSNAME
           
static boolean DEBUG
           
private static Object DELETED_PERSISTABLE_SET_KEY
           
private static String EMPTY_COLLECTION_ASSERT_MESSAGE
           
private  KeyedEventListener listener
           
private static DebugWriter LOG
           
private static AccessController NOOP_ACCESS_CONTROLLER
           
private static PagingSessionCache pagingSessionCache
           
private static RefreshSpec PREPARE_FOR_MODIFICATION_DEFAULT
           
(package private) static Boolean propExecuteQueues
           
private static Object REFERENTIAL_INTEGRITY_VALIDATOR_KEY
           
private static String RESOURCE
           
private static AccessControllerProcessor STANDARD_AC_PROCESSOR
           
private static AccessController STANDARD_ACCESS_CONTROLLER
           
private static AccessControllerProcessor STANDARD_NOOP_AC_PROCESSOR
           
 
Fields inherited from class wt.services.StandardManager
 
Fields inherited from interface wt.services.Manager
MANAGER_SERVICE, STARTUP_AUTOMATIC, STARTUP_MANUAL, STATUS_EMERGENCY_SHUTDOWN, STATUS_EMERGENCY_SHUTTING_DOWN, STATUS_SHUTDOWN, STATUS_SHUTDOWN_ERRORS, STATUS_SHUTDOWN_FAILURE, STATUS_SHUTTING_DOWN, STATUS_STARTED, STATUS_STARTED_ERRORS, STATUS_STARTING_UP, STATUS_STARTUP_FAILURE
 
Constructor Summary
StandardPersistenceManager()
           
 
Method Summary
private  QueryResult _find(StatementSpec a_statementSpec, ResultProcessor a_resultProcessor)
           
private  QueryResult _query(StatementSpec a_statementSpec, AccessControllerProcessor a_accessControllerProcessor, ResultProcessor a_resultProcessor)
           
private  WTCollection buildFailedCollection(WTCollection a_objects, boolean a_insertOperation)
           
protected  void checkDelete(Persistable obj)
          Ensure that it is valid to delete the given persistable object from the datastore.
protected  void checkModify(Persistable obj)
          Ensure that it is valid to modify the given persistable object in the datastore.
private  void checkOperation(WTCollection a_objects, int a_operation, boolean a_checkAttributes)
          Ensure that it is valid to perform the specified operation on the specified persistable objects in the datastore.
protected  void checkStore(Persistable obj)
          Ensure that it is valid to store the given persistable object into the datastore.
 BinaryLink copyLink(BinaryLink linkToCopy, Persistable roleObject, String roleObjectRole, Persistable otherRoleObject)
          Copies a link by duplicating it, replacing the role members, and persisting the new link using a server-side insert.
 WTValuedHashMap copyLink(WTValuedHashMap linksToCopy)
          Copies links in the specified Map for each key (original copy) by persisting the associated value (new link) using a server-side insert.
 Persistable delete(Persistable obj)
          Removes the given persistable object from the datastore.
 WTSet delete(WTSet a_objects)
          Removes the specified persistable objects from the datastore.
private  void dispatchVetoableEvent(PersistenceManagerEvent a_event, boolean a_single)
           
private  void dispatchVetoableEvent(String a_eventType, Persistable a_obj)
           
private  void dispatchVetoableEvent(String a_eventType, WTCollection a_objs)
           
 int execute(AbstractBatchSpec a_batchSpec)
          This method executes a batch update or delete operation on the specified Batch Specification.
 QueryResult expand(Persistable obj, String role, Class linkClass, boolean onlyOtherSide)
          Retrieves objects related to the given persistable object given a role and link class.
private  QueryResult expand(Persistable obj, String role, Class linkClass, boolean onlyOtherSide, AccessControllerProcessor a_accessControllerProcessor, boolean a_sorted)
          Retrieves objects related to the given persistable object given a role and link class.
 QueryResult expand(Persistable obj, String role, Class linkClass, boolean onlyOtherSide, boolean a_sorted)
          Retrieves objects related to the given persistable object given a role and link class.
 QueryResult expand(Persistable obj, String role, QuerySpec criteria, boolean onlyOtherSide)
          Retrieves objects related to the given persistable object given a role, an association name and selection criteria.
private  QueryResult expand(Persistable obj, String role, QuerySpec criteria, boolean onlyOtherSide, AccessControllerProcessor a_accessControllerProcessor)
          Retrieves objects related to the given persistable object given a role, an association name and selection criteria.
private static WTSet filter(WTSet a_objects, Set a_filterSet)
          This method filters Persistable objects that have already been removed.
 QueryResult find(Class targetLinkClass, ObjectIdentifier obj1Oid, String obj1Role, ObjectIdentifier obj2Oid)
          Retrieves any and all link objects that exist between two Persistable objects given their object identifiers.
 QueryResult find(Class targetLinkClass, Persistable obj1, String obj1Role, Persistable obj2)
          Retrieves any and all link objects that exist between two given Persistable objects.
 QueryResult find(QuerySpec criteria)
          Deprecated. as of R8.0, use find(StatementSpec).
 QueryResult find(StatementSpec a_statementSpec)
          Retrieves persistable objects from the datastore given the specified statement.
 ResultProcessor find(StatementSpec a_statementSpec, ResultProcessor a_resultProcessor)
          Retrieves persistable objects from the datastore for the specified statement.
 String getConceptualClassname()
          Deprecated.  
 InputStream getLob(LobLocator lob)
          Returns an input stream to the Lob associated with the given lob locator.
 String getNextSequence(Class a_class)
          Given the sequence class as input, return the next value.
 String getNextSequence(String sequenceName)
          Deprecated. as of R8.0, use getNextSequence(Class).
static PagingSessionCache getPagingSessionCache()
           
 void inflate(QueryResult queryResult, Vector displayAttributes)
          Emit the INFLATE_RESULT event to inflate the search results for SearchTask search.
 void insert(Persistable obj)
          Stores the given Persistable object into the datastore.
 void insert(Persistable obj, Timestamp createDate, Timestamp modifyDate)
          Stores the given Persistable object into the datastore.
 void insert(WTCollection a_objects)
          Stores the given Persistable object into the datastore.
 void lock(Object a_class)
          Performs a database lock on the given class table.
 void lock(Persistable obj)
          Performs a database lock on the given Persistable's row.
 void lock(Persistable obj, boolean wait)
          Performs a database lock on the given Persistable's row.
 void lock(Persistable obj, int retry, int sleepIntervalSeconds)
          Performs a database lock on the given Persistable's row.
 Persistable lockAndRefresh(Persistable obj)
          Lock and refresh the object.
private  QuerySpec makeQuerySpec(Class targetLinkClass, ObjectIdentifier obj1Oid, String obj1Role, ObjectIdentifier obj2Oid)
          Make a QuerySpec for all link objects that exist between two Persistable objects given their object identifiers.
private  QuerySpec makeQuerySpec(Class targetLinkClass, Persistable obj1, String obj1Role, Persistable obj2)
          Make a QuerySpec for all link objects that exist between two Persistable objects.
 Persistable modify(Persistable obj)
          Updates the given Persistable object in the datastore.
 Persistable modify(Persistable obj, String attrName, ObjectMappable objAttr)
          Updates the given Persistable object in the datastore with the values specified in the ObjectMappable attribute.
 WTCollection modify(WTCollection a_objects)
          Updates the specified Persistable objects in the datastore.
 QueryResult navigate(Persistable obj, String role, Class linkClass)
          Retrieves objects related to the given persistable object given a role and link class.
 QueryResult navigate(Persistable obj, String role, Class linkClass, boolean onlyOtherSide)
          Retrieves objects related to the given persistable object given a role and link class.
 QueryResult navigate(Persistable obj, String role, QuerySpec criteria)
          Retrieves objects related to the given persistable object given a role, an association name and selection criteria.
 QueryResult navigate(Persistable obj, String role, QuerySpec criteria, boolean onlyOtherSide)
          Retrieves objects related to the given persistable object given a role, an association name and selection criteria.
static StandardPersistenceManager newStandardPersistenceManager()
          Default factory for the class.
protected  void performStartupProcess()
          

Supported API: false
 Persistable prepareForModification(Persistable obj)
          This method refreshes the given object and then checks whether the user has access control rights to modify it.
 WTCollection prepareForModification(WTCollection a_objects)
          This method refreshes the given WTCollection and then checks whether the user has access control rights to modify it.
 Persistable prepareForModification(WTReference objRef)
          This method refreshes the given object reference and then checks whether the user has access control rights to modify it.
 Persistable prepareForView(Persistable obj)
          This method refreshes the given object and then checks whether the user has access control rights to view it.
 Persistable prepareForView(WTReference objRef)
          This method refreshes the given object reference and then checks whether the user has access control rights to view it.
private  void processRemoveOids(ClassInfo a_targetClassInfo, OidArray a_oidArray, int a_targetOidColumnIndex, int a_sourceOidColumnIndex, HashSet a_deletedPersistableSet, HashSet a_recursiveOwnerSet, WTSet a_candidateObjects)
          Processes OIDs that are to be removed from the datastore as a result of referential integrity processing.
 QueryResult query(Class targetLinkClass, ObjectIdentifier obj1Oid, String obj1Role, ObjectIdentifier obj2Oid)
          Retrieves any and all link objects that exist between two Persistable objects given their object identifiers.
 QueryResult query(Class targetLinkClass, Persistable obj1, String obj1Role, Persistable obj2)
          Retrieves any and all link objects that exist between two given Persistable objects.
 QueryResult query(QuerySpec qs)
          Retrieves persistable objects from the datastore given the specified selection criteria.
 QueryResult query(StatementSpec a_statementSpec)
          Retrieves persistable objects from the datastore given the specified statement.
 QueryResult query(StatementSpec a_statementSpec, AccessControllerProcessor a_accessControllerProcessor)
          

Supported API: false
 void query(StatementSpec a_statementSpec, AccessControllerProcessor a_accessControllerProcessor, ResultProcessor a_resultProcessor)
          This method queries the persistent datastore.
 void query(StatementSpec a_statementSpec, ResultProcessor a_resultProcessor)
          Retrieves persistable objects from the datastore for the specified statement.
private  QueryResult queryCascadeRoles(WTSet a_objects, Map a_map)
          This method builds and executes a query to return all of the role objects that the remove should cascade to.
private  ObjectSetVector queryOwnedLinks(ClassInfo a_targetClassInfo, WTSet a_objects, List a_list)
          This method builds and executes a query to return all of the links that are owned by the specified objects.
 Persistable refresh(ObjectIdentifier objId)
          Retrieves a Persistable object from the database given its object identifier.
 Persistable refresh(ObjectIdentifier objId, boolean lock)
          Retrieves a Persistable object from the database given its object identifier.
 Persistable refresh(Persistable obj)
          Retrieves the given Persistable object from the database to restore its state.
 Persistable refresh(Persistable obj, boolean fullRefresh)
          Retrieves the given Persistable object from the database to restore its state.
 Persistable refresh(Persistable obj, boolean fullRefresh, boolean inPlace)
          Retrieves the given Persistable object from the database to restore its state.
 Persistable refresh(Persistable obj, boolean fullRefresh, boolean inPlace, boolean lock)
          Retrieves the given Persistable object from the database to restore its state.
 void registerEvents(ManagerService ms)
          Register events with the passed ManagerService.
private  void remove(ClassInfo a_targetClass, WTSet a_objects, boolean a_checkUpdateCount, HashSet a_recursiveOwnerSet, WTSet a_candidateObjects)
          Removes the given persistables from the datastore.
 void remove(Persistable obj)
          Removes the given persistable object from the datastore.
 void remove(WTSet a_objects)
          Removes the specified objects from the datastore.
private  int removeBatch(ClassInfo a_targetClass, WTSet a_objects, boolean a_checkUpdateCount, WTSet a_candidateObjects, Set a_deletedPersistableSet)
          This method removes the specified objects optionally checking to ensure that update counts match.
static boolean requiresInflate(String package_name, Vector display_attributes)
           
(package private) static void resetPersistInfoState(Object a_persistInfoState)
           
 Persistable restore(ObjectIdentifier objId)
          Retrieves a Persistable object from the database given its object identifier.
 Persistable restore(ObjectIdentifier objId, boolean checkFreshness)
          Retrieves a Persistable object from the database given its object identifier.
 Persistable restore(ObjectIdentifier objId, boolean checkFreshness, boolean lock)
          Retrieves a Persistable object from the database given its object identifier.
 Persistable restore(Persistable obj)
          Retrieves the given Persistable object from the database to restore its state.
 Persistable restore(Persistable obj, boolean fullRestore)
          Retrieves the given Persistable object from the database to restore its state.
 Persistable restore(Persistable obj, boolean fullRestore, boolean inPlace)
          Retrieves the given Persistable object from the database to restore its state.
 Persistable restore(Persistable obj, boolean fullRestore, boolean inPlace, boolean checkFreshness)
          Retrieves the given Persistable object from the database to restore its state.
 Persistable restore(Persistable obj, boolean fullRestore, boolean inPlace, boolean checkFreshness, boolean lock)
          Retrieves the given Persistable object from the database to restore its state.
 Persistable save(Persistable obj)
          Invokes the modify method if the given object is persistent, otherwise the save method invokes the store method.
 WTCollection save(WTCollection objects)
          Invokes the modify method on the objects that are already persisted, otherwise invokes the store method.
(package private) static ArrayList savePersistInfoState(WTCollection a_objs)
           
 Persistable store(Persistable obj)
          Stores the specified Persistable object in the datastore.
 Persistable store(Persistable obj, Timestamp createDate, Timestamp modifyDate)
          Stores the given Persistable object in the datastore with the given timestamps.
 WTCollection store(WTCollection a_objects)
          Stores the specified collection of Persistable objects in the datastore.
 void update(Persistable obj)
          Updates the given Persistable object in the datastore.
 void update(Persistable obj, boolean changeModifyDate)
          Updates the given Persistable object in the datastore.
 void update(Persistable obj, String attrName, ObjectMappable objAttr)
          

Supported API: false
 void update(WTCollection a_objects)
          Updates the specified objects in the datastore.
 void update(WTCollection a_objects, boolean changeModifyDate)
          Updates the specified objects in the datastore.
 long updateLob(Persistable obj, LobLocator lob, InputStream stream, boolean changeModifyDate)
          Saves the specified input stream of unknown length as a Lob of the given Persistable object.
 void updateLob(Persistable obj, LobLocator lob, InputStream stream, long length, boolean changeModifyDate)
          Saves the specified input stream as a Lob of the given Persistable object.
private static void updatePagingSessionCache(PagingSession pagingSession)
           
private static void validateCollection(WTCollection a_objects, boolean a_lock)
           
 
Methods inherited from class wt.services.StandardManager
emergencyShutdown, emergencyShutdownComplete, emergencyShuttingDown, getClassInfo, getManagerService, getManagerStatus, getName, getStartupType, init, initialize, initialize, isStarted, newStandardManager, newStandardManager, performEmergencyShutdownProcess, performShutdownProcess, setManagerService, shutdown, shutdownFailure, shutdownSuccess, shuttingDown, started, startedErrors, startingUp, startup, startupFailure, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

DEBUG

public static final boolean DEBUG

LOG

private static final DebugWriter LOG

NOOP_ACCESS_CONTROLLER

private static final AccessController NOOP_ACCESS_CONTROLLER

STANDARD_ACCESS_CONTROLLER

private static final AccessController STANDARD_ACCESS_CONTROLLER

STANDARD_NOOP_AC_PROCESSOR

private static final AccessControllerProcessor STANDARD_NOOP_AC_PROCESSOR

STANDARD_AC_PROCESSOR

private static final AccessControllerProcessor STANDARD_AC_PROCESSOR

pagingSessionCache

private static PagingSessionCache pagingSessionCache

listener

private KeyedEventListener listener

PREPARE_FOR_MODIFICATION_DEFAULT

private static final RefreshSpec PREPARE_FOR_MODIFICATION_DEFAULT

EMPTY_COLLECTION_ASSERT_MESSAGE

private static final String EMPTY_COLLECTION_ASSERT_MESSAGE
See Also:
Constant Field Values

propExecuteQueues

static Boolean propExecuteQueues

REFERENTIAL_INTEGRITY_VALIDATOR_KEY

private static final Object REFERENTIAL_INTEGRITY_VALIDATOR_KEY

DELETED_PERSISTABLE_SET_KEY

private static final Object DELETED_PERSISTABLE_SET_KEY

CHECK_STORE

private static final int CHECK_STORE
See Also:
Constant Field Values

CHECK_MODIFY

private static final int CHECK_MODIFY
See Also:
Constant Field Values

CHECK_DELETE

private static final int CHECK_DELETE
See Also:
Constant Field Values
Constructor Detail

StandardPersistenceManager

public StandardPersistenceManager()
Method Detail

getConceptualClassname

public String getConceptualClassname()
Deprecated.  

Returns the conceptual (modeled) name for the class.

Supported API: false

Specified by:
getConceptualClassname in interface NetFactor
Overrides:
getConceptualClassname in class StandardManager
Returns:
String

checkStore

protected void checkStore(Persistable obj)
                   throws WTException
Ensure that it is valid to store the given persistable object into the datastore.

Supported API: false

Parameters:
obj - The persistable object that needs to be validated before it is stored in the datastore.
Throws:
WTException

checkDelete

protected void checkDelete(Persistable obj)
                    throws WTException
Ensure that it is valid to delete the given persistable object from the datastore.

Supported API: false

Parameters:
obj - The persistable object that needs to be validated before it is deleted from the datastore.
Throws:
WTException

checkModify

protected void checkModify(Persistable obj)
                    throws WTException
Ensure that it is valid to modify the given persistable object in the datastore.

Supported API: false

Parameters:
obj - The persistable object that needs to be validated before it is modified in the datastore.
Throws:
WTException

registerEvents

public void registerEvents(ManagerService ms)
Register events with the passed ManagerService.

Supported API: false

Specified by:
registerEvents in interface Manager
Overrides:
registerEvents in class StandardManager
Parameters:
ms - the ManagerService with which to register events

performStartupProcess

protected void performStartupProcess()
                              throws ManagerException


Supported API: false

Overrides:
performStartupProcess in class StandardManager
Throws:
ManagerException

newStandardPersistenceManager

public static StandardPersistenceManager newStandardPersistenceManager()
                                                                throws WTException
Default factory for the class.

Supported API: false

Returns:
StandardPersistenceManager
Throws:
WTException

delete

public Persistable delete(Persistable obj)
                   throws WTException
Removes the given persistable object from the datastore. If the given Persistable object participates as either a role A or role B member, then referential integrity processing will occur as specified for that role. The delete method ensures that the operation is valid before removing the Persistable object from the datastore.

The target for this operations dispatched event is the specified Persistable object for a single object event listener and a WTCollection containing the specified Persistable object for a multiple object event listener. Note that the PRE_REMOVE event is not supported for a single object event listener.

The delete performs the following operations.

  1. Dispatches a PersistenceManagerEvent.PRE_DELETE event.
  2. Ensures that this Persistable object is persistent.
  3. Ensures that attributes are valid (by invoking Persistable.checkAttributes()).
  4. Uses Access Control to determine if the user is allowed to delete this business object.
  5. Deletes associated BinaryLink objects that are owned by the role object that is being deleted.
  6. Dispatches a PersistenceManagerEvent.CLEANUP_LINK event.
  7. Dispatches a PersistenceManagerEvent.PRE_REMOVE event.
  8. Deletes this Persistable object in the database, ensuring that the object has not gone stale (that is, someone else has already modified this object in the database).
  9. Sets new values in the persistent information attributes to indicate that this object has been deleted.
  10. Dispatches a PersistenceManagerEvent.REMOVE event.
  11. If this object is of type BinaryLink, then any cascaded role objects are deleted.
  12. Dispatches a PersistenceManagerEvent.POST_DELETE event.
  13. Returns the Persistable object to the caller.

Before the commit of the transaction that this delete operation occurs in, the persistence service verifies that no BinaryLink objects exist that reference any of the removed objects.



Supported API: true

Specified by:
delete in interface PersistenceManager
Parameters:
obj - The object to be deleted from the datastore.
Returns:
Persistable
Throws:
WTException
See Also:
Delete

find

public QueryResult find(QuerySpec criteria)
                 throws WTException
Deprecated. as of R8.0, use find(StatementSpec).

Retrieves persistable objects from the datastore given the specified selection criteria. The find methods validates the resulting set of objects that were retrieved from the datastore before returning them to the invoking method.

Supported API: false

Specified by:
find in interface PersistenceManager
Parameters:
criteria - The search criteria to use for the find
Returns:
QueryResult
Throws:
WTException

find

public QueryResult find(Class targetLinkClass,
                        Persistable obj1,
                        String obj1Role,
                        Persistable obj2)
                 throws WTException
Retrieves any and all link objects that exist between two given Persistable objects. The method validates the resulting set of link objects retrieved from the database before returning them to the invoking method.

Supported API: true

Specified by:
find in interface PersistenceManager
Parameters:
targetLinkClass -
obj1 -
obj1Role -
obj2 -
Returns:
QueryResult
Throws:
WTException

find

public QueryResult find(Class targetLinkClass,
                        ObjectIdentifier obj1Oid,
                        String obj1Role,
                        ObjectIdentifier obj2Oid)
                 throws WTException,
                        InvalidRoleException
Retrieves any and all link objects that exist between two Persistable objects given their object identifiers. The method validates the resulting set of link objects retrieved from the database before returning them to the invoking method.

Supported API: true

Specified by:
find in interface PersistenceManager
Parameters:
targetLinkClass -
obj1Oid -
obj1Role -
obj2Oid -
Returns:
QueryResult
Throws:
WTException
InvalidRoleException

getLob

public InputStream getLob(LobLocator lob)
                   throws WTException
Returns an input stream to the Lob associated with the given lob locator.

Supported API: true

Specified by:
getLob in interface PersistenceManager
Parameters:
lob - the Lob locator.
Returns:
InputStream
Throws:
WTException

modify

public Persistable modify(Persistable obj)
                   throws WTException
Updates the given Persistable object in the datastore. The modify method ensures that the operation is valid before updating the Persistable object in the datastore.

The target for this operations dispatched event is the specified Persistable object for a single object event listener and a WTCollection containing the specified Persistable object for a multiple object event listener.

The modify method performs the following operations.

  1. Dispatches a PersistenceManagerEvent.PRE_MODIFY event.
  2. Ensures that this Persistable object is persistent.
  3. Ensures that attributes are valid (by invoking Persistable.checkAttributes()).
  4. Uses Access Control to determine if the user is allowed to modify this business object.
  5. Updates this Persistable object in the database, ensuring that the object has not gone stale (that is, someone else has already modified this object in the database). Note that any attributes derived from values that exist in other tables are not updated in the database.
  6. Sets new values in the persistent information attributes, such as update count and modify timestamp.
  7. Dispatches a PersistenceManagerEvent.UPDATE event.
  8. Dispatches a PersistenceManagerEvent.POST_MODIFY event.
  9. Returns the Persistable object to the caller.



Supported API: true

Specified by:
modify in interface PersistenceManager
Parameters:
obj - The object to be modified in the datastore
Returns:
Persistable
Throws:
WTException

navigate

public QueryResult navigate(Persistable obj,
                            String role,
                            Class linkClass)
                     throws WTException
Retrieves objects related to the given persistable object given a role and link class. The navigate methods validates the resulting set of objects that were retrieved from the datastore before returning them to the invoking method. Returns only the otherside objects, not the links.

Supported API: true

Specified by:
navigate in interface PersistenceManager
Parameters:
obj - The persistable object to navigate.
role - The role to navigate to
linkClass - The link class to navigate
Returns:
QueryResult
Throws:
WTException

navigate

public QueryResult navigate(Persistable obj,
                            String role,
                            Class linkClass,
                            boolean onlyOtherSide)
                     throws WTException
Retrieves objects related to the given persistable object given a role and link class. The navigate methods validates the resulting set of objects that were retrieved from the datastore before returning them to the invoking method. If onlyOtherSide is false, the links are returned as well as the other side objects. Note that only the links are returned in the QueryResult, the other side objects are accessible using the link's getOtherObject() method.

Supported API: true

Specified by:
navigate in interface PersistenceManager
Parameters:
obj -
role -
linkClass - The link class for the association to navigate
onlyOtherSide - Indicates that only the other side objects of the association should be returned. If false, then the link objects are returned (the other side object can be obtained via the link object's getter method).
Returns:
QueryResult
Throws:
WTException

navigate

public QueryResult navigate(Persistable obj,
                            String role,
                            QuerySpec criteria)
                     throws WTException
Retrieves objects related to the given persistable object given a role, an association name and selection criteria. The find methods validates the resulting set of objects that were retrieved from the datastore before returning them to the invoking method. This version only returns other side objects.

Supported API: true

Specified by:
navigate in interface PersistenceManager
Parameters:
obj - The persistable object to navigate
role - The role to navigate to
criteria - Selection criteria for the navigate. This QuerySpec must contain the target and link class at class index 0 and 1, respectively.
Returns:
QueryResult
Throws:
WTException

navigate

public QueryResult navigate(Persistable obj,
                            String role,
                            QuerySpec criteria,
                            boolean onlyOtherSide)
                     throws WTException
Retrieves objects related to the given persistable object given a role, an association name and selection criteria. The find methods validates the resulting set of objects that were retrieved from the datastore before returning them to the invoking method. This version returns other side objects and also the links if onlyOtherSide is false. Note that only the links are returned in the QueryResult, the other side objects are accessible using the link's getOtherObject() method.

Supported API: true

Specified by:
navigate in interface PersistenceManager
Parameters:
obj - The persistable object to navigate
role - The role to navigate to
criteria - Selection criteria for the navigate. This QuerySpec must contain the target and link class at class index 0 and 1, respectively.
onlyOtherSide - Indicates that only the other side objects of the association should be returned. If false, then the link objects are returned (the other side object can be obtained via the link object's getter method).
Returns:
QueryResult
Throws:
WTException

refresh

public Persistable refresh(Persistable obj,
                           boolean fullRefresh)
                    throws WTException,
                           ObjectNoLongerExistsException
Retrieves the given Persistable object from the database to restore its state. The object is not refreshed in place.

Supported API: true

Specified by:
refresh in interface PersistenceManager
Parameters:
obj - The persistable object to be refreshed
fullRefresh - Set to true if the object references for the target object should be refreshed as well.
Returns:
Persistable
Throws:
WTException
ObjectNoLongerExistsException

refresh

public Persistable refresh(Persistable obj)
                    throws WTException,
                           ObjectNoLongerExistsException
Retrieves the given Persistable object from the database to restore its state. Object references for the target object are not refreshed and the object is not refreshed in place.

Supported API: true

Specified by:
refresh in interface PersistenceManager
Parameters:
obj - The persistable object to be refreshed
Returns:
Persistable
Throws:
WTException
ObjectNoLongerExistsException

refresh

public Persistable refresh(ObjectIdentifier objId)
                    throws WTException,
                           ObjectNoLongerExistsException
Retrieves a Persistable object from the database given its object identifier. Object references of the target object are not refreshed.

Supported API: true

Specified by:
refresh in interface PersistenceManager
Parameters:
objId -
Returns:
Persistable
Throws:
WTException
ObjectNoLongerExistsException

save

public Persistable save(Persistable obj)
                 throws WTException
Invokes the modify method if the given object is persistent, otherwise the save method invokes the store method.

Supported API: true

Specified by:
save in interface PersistenceManager
Parameters:
obj - The persistable object to be saved
Returns:
Persistable
Throws:
WTException

store

public Persistable store(Persistable obj)
                  throws WTException
Stores the specified Persistable object in the datastore. The store method ensures that the operation is valid before storing the Persistable object in the datastore.

The target for this operations dispatched event is the specified Persistable object for a single object event listener and a WTCollection containing the specified Persistable object for a multiple object event listener.

The store method performs the following operations.

  1. Dispatches a PersistenceManagerEvent.PRE_STORE event.
  2. Ensures that this Persistable object is not yet persistent.
  3. Ensures that attributes are valid (by invoking Persistable.checkAttributes()).
  4. Uses Access Control to determine if the user is allowed to create this business object.
  5. Inserts the Persistable object into the database and, in so doing, assigns an ObjectIdentifier and initializes the persistence information.
  6. Dispatches a PersistenceManagerEvent.INSERT event.
  7. Dispatches a PersistenceManagerEvent.POST_STORE event.
  8. Returns the Persistable object to the caller.



Supported API: true

Specified by:
store in interface PersistenceManager
Parameters:
obj - The object to be stored in the datastore
Returns:
Persistable
Throws:
WTException

modify

public Persistable modify(Persistable obj,
                          String attrName,
                          ObjectMappable objAttr)
                   throws WTException
Updates the given Persistable object in the datastore with the values specified in the ObjectMappable attribute.

Supported API: true

Specified by:
modify in interface PersistenceManager
Parameters:
obj -
attrName -
objAttr -
Returns:
Persistable
Throws:
WTException

prepareForModification

public Persistable prepareForModification(Persistable obj)
                                   throws ModificationNotAllowedException,
                                          ObjectNoLongerExistsException,
                                          NotAuthorizedException,
                                          WTException
This method refreshes the given object and then checks whether the user has access control rights to modify it.

The method throws the ModificationNotAllowedException if the user is not allowed to modify the business object but is allowed to view it. Invoke the getNonModifiableObject method on the ModificationNotAllowedException to get a refreshed copy of the object if viewing it is desired.

The method throws the NotAuthorizedException if the user is not allowed to modify nor view the given object.

Supported API: false

Specified by:
prepareForModification in interface PersistenceManager
Parameters:
obj -
Returns:
Persistable
Throws:
ModificationNotAllowedException
ObjectNoLongerExistsException
NotAuthorizedException
WTException

getNextSequence

public String getNextSequence(String sequenceName)
                       throws WTException
Deprecated. as of R8.0, use getNextSequence(Class).

Given the name of the sequence as input, return the next value.

Supported API: false

Specified by:
getNextSequence in interface PersistenceManager
Parameters:
sequenceName -
Returns:
String
Throws:
WTException

prepareForView

public Persistable prepareForView(Persistable obj)
                           throws ObjectNoLongerExistsException,
                                  NotAuthorizedException,
                                  WTException
This method refreshes the given object and then checks whether the user has access control rights to view it.

The method throws the NotAuthorizedException if the user is not allowed to view the given object.

Supported API: false

Specified by:
prepareForView in interface PersistenceManager
Parameters:
obj -
Returns:
Persistable
Throws:
ObjectNoLongerExistsException
NotAuthorizedException
WTException

inflate

public void inflate(QueryResult queryResult,
                    Vector displayAttributes)
             throws WTException
Emit the INFLATE_RESULT event to inflate the search results for SearchTask search.

Supported API: false

Specified by:
inflate in interface PersistenceManager
Parameters:
queryResult - The results from the query.
displayAttributes - The attributes that the client wants to be able to display. String of attribute class and where it came from, not the attribute.
Throws:
WTException

prepareForModification

public Persistable prepareForModification(WTReference objRef)
                                   throws ModificationNotAllowedException,
                                          ObjectNoLongerExistsException,
                                          NotAuthorizedException,
                                          WTException
This method refreshes the given object reference and then checks whether the user has access control rights to modify it.

The method throws the ModificationNotAllowedException if the user is not allowed to modify the business object but is allowed to view it. Invoke the getNonModifiableObject method on the ModificationNotAllowedException to get a refreshed copy of the object if viewing it is desired.

The method throws the NotAuthorizedException if the user is not allowed to modify nor view the given object.

Supported API: false

Specified by:
prepareForModification in interface PersistenceManager
Parameters:
objRef -
Returns:
Persistable
Throws:
ModificationNotAllowedException
ObjectNoLongerExistsException
NotAuthorizedException
WTException

prepareForView

public Persistable prepareForView(WTReference objRef)
                           throws ObjectNoLongerExistsException,
                                  NotAuthorizedException,
                                  WTException
This method refreshes the given object reference and then checks whether the user has access control rights to view it.

The method throws the NotAuthorizedException if the user is not allowed to view the given object.

Supported API: false

Specified by:
prepareForView in interface PersistenceManager
Parameters:
objRef -
Returns:
Persistable
Throws:
ObjectNoLongerExistsException
NotAuthorizedException
WTException

find

public QueryResult find(StatementSpec a_statementSpec)
                 throws WTException
Retrieves persistable objects from the datastore given the specified statement. The find methods validates the resulting set of objects that were retrieved from the datastore before returning them to the invoking method.

Supported API: true

Specified by:
find in interface PersistenceManager
Parameters:
a_statementSpec - The search criteria to use for the find
Returns:
QueryResult
Throws:
WTException

refresh

public Persistable refresh(Persistable obj,
                           boolean fullRefresh,
                           boolean inPlace)
                    throws WTException,
                           ObjectNoLongerExistsException
Retrieves the given Persistable object from the database to restore its state.

Supported API: true

Specified by:
refresh in interface PersistenceManager
Parameters:
obj - The persistable object to be refreshed
fullRefresh - Set to true if the object references for the target object should be refreshed as well.
inPlace - Set to true if the target object should be refreshed in place.
Returns:
Persistable
Throws:
WTException
ObjectNoLongerExistsException
See Also:
In-place refresh

find

public ResultProcessor find(StatementSpec a_statementSpec,
                            ResultProcessor a_resultProcessor)
                     throws WTException
Retrieves persistable objects from the datastore for the specified statement. The find methods validates the resulting set of objects that were retrieved from the datastore before returning via the specified ResultProcessor.

Supported API: true

Specified by:
find in interface PersistenceManager
Parameters:
a_statementSpec -
a_resultProcessor -
Returns:
ResultProcessor
Throws:
WTException

refresh

public Persistable refresh(Persistable obj,
                           boolean fullRefresh,
                           boolean inPlace,
                           boolean lock)
                    throws WTException,
                           ObjectNoLongerExistsException
Retrieves the given Persistable object from the database to restore its state.

Supported API: true

Specified by:
refresh in interface PersistenceManager
Parameters:
obj - The persistable object to be refreshed
fullRefresh - Set to true if the object references for the target object should be refreshed as well.
inPlace - Set to true if the target object should be refreshed in place.
lock - Specifies whether the object should be locked as part of the refresh. This value should only be true when the call is within the context of a server-side transaction.
Returns:
Persistable
Throws:
WTException
ObjectNoLongerExistsException
See Also:
In-place refresh

lockAndRefresh

public Persistable lockAndRefresh(Persistable obj)
                           throws WTException
Lock and refresh the object. This method should only be called within the context of a server-side transaction.

Supported API: false

Specified by:
lockAndRefresh in interface PersistenceManager
Parameters:
obj - The persistable object to be refreshed
Returns:
Persistable
Throws:
WTException

store

public WTCollection store(WTCollection a_objects)
                   throws WTException
Stores the specified collection of Persistable objects in the datastore. The store method ensures that the operation is valid before storing the Persistable objects in the datastore.

The target for this operations dispatched event is a Persistable object for a single object event listener (the listener is called once for each object in the collection) and the specified collection of Persistable objects for a multiple object event listener.

The store method performs the following operations.

  1. Dispatches a PersistenceManagerEvent.PRE_STORE event.
  2. Ensures that each Persistable object is not yet persistent.
  3. Ensures that attributes are valid (by invoking Persistable.checkAttributes() for each object).
  4. Uses Access Control to determine if the user is allowed to create each business object.
  5. Inserts the Persistable objects into the database and, in so doing, assigns each an ObjectIdentifier and initializes the persistence information.
  6. Dispatches a PersistenceManagerEvent.INSERT event.
  7. Dispatches a PersistenceManagerEvent.POST_STORE event.
  8. Returns the collection of Persistable objects to the caller.



Supported API: true

Specified by:
store in interface PersistenceManager
Parameters:
a_objects - The objects to be stored in the datastore
Returns:
WTCollection
Throws:
WTException

modify

public WTCollection modify(WTCollection a_objects)
                    throws WTException
Updates the specified Persistable objects in the datastore. The modify method ensures that the operation is valid before updating the Persistable objects in the datastore.

The target for this operations dispatched event is the specified Persistable object for a single object event listener (the listener is called once for each object in the collection) and a WTCollection containing the specified Persistable object for a multiple object event listener.

The modify method performs the following operations.

  1. Dispatches a PersistenceManagerEvent.PRE_MODIFY event.
  2. Ensures that each Persistable object is persistent.
  3. Ensures that attributes are valid (by invoking Persistable.checkAttributes() for each object).
  4. Uses Access Control to determine if the user is allowed to modify each business object.
  5. Updates the Persistable objects in the database, ensuring that the objects have not gone stale (that is, someone else has already modified this object in the database). Note that any attributes derived from values that exist in other tables are not updated in the database.
  6. Sets new values in the persistent information attributes, such as update count and modify timestamp.
  7. Dispatches a PersistenceManagerEvent.UPDATE event.
  8. Dispatches a PersistenceManagerEvent.POST_MODIFY event.
  9. Returns the collection of Persistable objects to the caller.



Supported API: true

Specified by:
modify in interface PersistenceManager
Parameters:
a_objects - The objects to be modified in the datastore
Returns:
WTCollection
Throws:
WTException

delete

public WTSet delete(WTSet a_objects)
             throws WTException
Removes the specified persistable objects from the datastore. If a given Persistable object in the set participates as either a role A or role B member, then referential integrity processing will occur as specified for that role. The delete method ensures that the operation is valid before removing the Persistable objects from the datastore.

The target for this operations dispatched event is the specified Persistable object for a single object event listener (the listener is called once for each object in the collection) and a WTCollection containing the specified Persistable object for a multiple object event listener. Note that the PRE_REMOVE event is not supported for a single object event listener.

The delete performs the following operations.

  1. Dispatches a PersistenceManagerEvent.PRE_DELETE event.
  2. Ensures that this Persistable objects are persistent.
  3. Ensures that attributes are valid (by invoking Persistable.checkAttributes() for each object).
  4. Uses Access Control to determine if the user is allowed to delete the business objects.
  5. Deletes associated BinaryLink objects that are owned by the role objects that are being deleted.
  6. Dispatches a PersistenceManagerEvent.CLEANUP_LINK event.
  7. Dispatches a PersistenceManagerEvent.PRE_REMOVE event.
  8. Deletes the Persistable objects in the datastore, ensuring that the objects have not gone stale (that is, someone else has already modified this object in the datastore).
  9. Sets new values in the persistent information attributes to indicate that this objects have been deleted.
  10. Dispatches a PersistenceManagerEvent.REMOVE event.
  11. For any objects that are of type BinaryLink, cascaded role objects are deleted.
  12. Dispatches a PersistenceManagerEvent.POST_DELETE event.
  13. Returns the collection of Persistable objects to the caller.

Before the commit of the transaction that this delete operation occurs in, the persistence service verifies that no BinaryLink objects exist that reference any of the removed objects.



Supported API: true

Specified by:
delete in interface PersistenceManager
Parameters:
a_objects - The objects to be deleted from the datastore.
Returns:
WTSet
Throws:
WTException
See Also:
Delete

prepareForModification

public WTCollection prepareForModification(WTCollection a_objects)
                                    throws ModificationNotAllowedException,
                                           NotAuthorizedException,
                                           WTException
This method refreshes the given WTCollection and then checks whether the user has access control rights to modify it.

The method throws the ModificationNotAllowedException if the user is not allowed to modify the business object but is allowed to view it. Invoke the getNonModifiableObjects method on the ModificationNotAllowedException to get a refreshed copy of the WTColection if viewing it is desired.

The method throws the NotAuthorizedException if the user is not allowed to modify nor view the given object.

Supported API: false

Specified by:
prepareForModification in interface PersistenceManager
Parameters:
a_objects - The objects to be modified in the datastore
Returns:
WTCollection
Throws:
ModificationNotAllowedException
NotAuthorizedException
WTException

save

public WTCollection save(WTCollection objects)
                  throws WTException
Invokes the modify method on the objects that are already persisted, otherwise invokes the store method.

Supported API: true

Specified by:
save in interface PersistenceManager
Parameters:
objects - The persistable objects to be saved
Returns:
WTCollection
Throws:
WTException

getNextSequence

public String getNextSequence(Class a_class)
                       throws WTException
Given the sequence class as input, return the next value. The specified sequence class must implement the DatastoreSequence interface.

Supported API: true

Specified by:
getNextSequence in interface PersistenceManager
Parameters:
a_class -
Returns:
String
Throws:
WTException

refresh

public Persistable refresh(ObjectIdentifier objId,
                           boolean lock)
                    throws WTException,
                           ObjectNoLongerExistsException
Retrieves a Persistable object from the database given its object identifier. Object references of the target object are not refreshed.

Supported API: true

Specified by:
refresh in interface PersistenceManager
Parameters:
objId -
lock -
Returns:
Persistable
Throws:
WTException
ObjectNoLongerExistsException

expand

public QueryResult expand(Persistable obj,
                          String role,
                          Class linkClass,
                          boolean onlyOtherSide)
                   throws WTException
Retrieves objects related to the given persistable object given a role and link class. This method provides low level access to the database and bypasses access control operations.

Supported API: false

Specified by:
expand in interface PersistenceManagerSvr
Parameters:
obj - The persistable object to navigate
role - The role to navigate to
linkClass - The link class to navigate
onlyOtherSide -
Returns:
QueryResult
Throws:
WTException

expand

public QueryResult expand(Persistable obj,
                          String role,
                          QuerySpec criteria,
                          boolean onlyOtherSide)
                   throws WTException
Retrieves objects related to the given persistable object given a role, an association name and selection criteria. This method provides low level access to the database and bypasses access control operations.

Supported API: false

Specified by:
expand in interface PersistenceManagerSvr
Parameters:
obj - The persistable object to navigate
role - The role to navigate to
criteria - Selection criteria for the navigate. This QuerySpec must contain the target and link class at class index 0 and 1, respectively.
onlyOtherSide -
Returns:
QueryResult
Throws:
WTException

insert

public void insert(Persistable obj)
            throws WTException
Stores the given Persistable object into the datastore. A transaction is started if one does not already exist. This method provides low level access to the database and bypasses access control operations.

Supported API: false

Specified by:
insert in interface PersistenceManagerSvr
Parameters:
obj - The object to be inserted into the datastore
Throws:
WTException

query

public QueryResult query(QuerySpec qs)
                  throws WTException
Retrieves persistable objects from the datastore given the specified selection criteria. This method provides low level access to the database and bypasses access control operations.

Supported API: false

Specified by:
query in interface PersistenceManagerSvr
Parameters:
qs -
Returns:
QueryResult
Throws:
WTException

query

public QueryResult query(Class targetLinkClass,
                         Persistable obj1,
                         String obj1Role,
                         Persistable obj2)
                  throws WTException
Retrieves any and all link objects that exist between two given Persistable objects.

Supported API: false

Specified by:
query in interface PersistenceManagerSvr
Parameters:
targetLinkClass -
obj1 -
obj1Role -
obj2 -
Returns:
QueryResult
Throws:
WTException

query

public QueryResult query(Class targetLinkClass,
                         ObjectIdentifier obj1Oid,
                         String obj1Role,
                         ObjectIdentifier obj2Oid)
                  throws WTException,
                         InvalidRoleException
Retrieves any and all link objects that exist between two Persistable objects given their object identifiers. The method validates the resulting set of link objects retrieved from the database before returning them to the invoking method.

Supported API: false

Specified by:
query in interface PersistenceManagerSvr
Parameters:
targetLinkClass -
obj1Oid -
obj1Role -
obj2Oid -
Returns:
QueryResult
Throws:
WTException
InvalidRoleException

remove

public void remove(Persistable obj)
            throws WTException
Removes the given persistable object from the datastore. A transaction is started if one does not already exist. This method provides low level access to the database and bypasses access control operations.

Supported API: false

Specified by:
remove in interface PersistenceManagerSvr
Parameters:
obj -
Throws:
WTException

restore

public Persistable restore(Persistable obj,
                           boolean fullRestore)
                    throws WTException,
                           ObjectNoLongerExistsException
Retrieves the given Persistable object from the database to restore its state. The object is not refreshed in place. This method provides low level access to the database and bypasses access control operations.

Supported API: false

Specified by:
restore in interface PersistenceManagerSvr
Parameters:
obj -
fullRestore - Set to true if the object references for the target object should be refreshed as well.
Returns:
Persistable
Throws:
WTException
ObjectNoLongerExistsException

restore

public Persistable restore(Persistable obj)
                    throws WTException,
                           ObjectNoLongerExistsException
Retrieves the given Persistable object from the database to restore its state. Object references for the target object are not refreshed and the object is not refreshed in place. This method provides low level access to the database and bypasses access control operations

Supported API: false

Specified by:
restore in interface PersistenceManagerSvr
Parameters:
obj -
Returns:
Persistable
Throws:
WTException
ObjectNoLongerExistsException

restore

public Persistable restore(ObjectIdentifier objId)
                    throws WTException,
                           ObjectNoLongerExistsException
Retrieves a Persistable object from the database given its object identifier. Object references for the target object are not refreshed. This method provides low level access to the database and bypasses access control operations.

Supported API: false

Specified by:
restore in interface PersistenceManagerSvr
Parameters:
objId - The object identifier of the persistable object to be restored
Returns:
Persistable
Throws:
WTException
ObjectNoLongerExistsException

restore

public Persistable restore(ObjectIdentifier objId,
                           boolean checkFreshness)
                    throws WTException,
                           ObjectNoLongerExistsException
Retrieves a Persistable object from the database given its object identifier. Object references for the target object are not refreshed. This method provides low level access to the database and bypasses access control operations.

Supported API: false

Specified by:
restore in interface PersistenceManagerSvr
Parameters:
objId - The object identifier of the persistable object to be restored
checkFreshness - Set to true if the target object should be checked for freshness to determine whether it is an expired or stale proxy.
Returns:
Persistable
Throws:
WTException
ObjectNoLongerExistsException

update

public void update(Persistable obj)
            throws WTException
Updates the given Persistable object in the datastore. A transaction is started if one does not already exist. This method provides low level access to the database and bypasses access control operations.

Supported API: false

Specified by:
update in interface PersistenceManagerSvr
Parameters:
obj -
Throws:
WTException

update

public void update(Persistable obj,
                   boolean changeModifyDate)
            throws WTException
Updates the given Persistable object in the datastore. A transaction is started if one does not already exist. This method provides low level access to the database and bypasses access control operations.

Supported API: false

Specified by:
update in interface PersistenceManagerSvr
Parameters:
obj - The object to be modified
changeModifyDate - Set to true if the modifyTimestamp is to be updated.
Throws:
WTException

update

public void update(Persistable obj,
                   String attrName,
                   ObjectMappable objAttr)
            throws WTException


Supported API: false

Specified by:
update in interface PersistenceManagerSvr
Parameters:
obj -
attrName -
objAttr -
Throws:
WTException

updateLob

public void updateLob(Persistable obj,
                      LobLocator lob,
                      InputStream stream,
                      long length,
                      boolean changeModifyDate)
               throws WTException
Saves the specified input stream as a Lob of the given Persistable object.

Supported API: false

Specified by:
updateLob in interface PersistenceManagerSvr
Parameters:
obj -
lob -
stream -
length -
changeModifyDate -
Throws:
WTException

updateLob

public long updateLob(Persistable obj,
                      LobLocator lob,
                      InputStream stream,
                      boolean changeModifyDate)
               throws WTException
Saves the specified input stream of unknown length as a Lob of the given Persistable object.

Supported API: false

Specified by:
updateLob in interface PersistenceManagerSvr
Parameters:
obj -
lob -
stream -
changeModifyDate -
Returns:
long
Throws:
WTException

lock

public void lock(Persistable obj)
          throws WTException
Performs a database lock on the given Persistable's row. Throws ObjectLockedException if the given object is already locked by another datastore connection.

Supported API: false

Specified by:
lock in interface PersistenceManagerSvr
Parameters:
obj -
Throws:
WTException

lock

public void lock(Persistable obj,
                 boolean wait)
          throws WTException
Performs a database lock on the given Persistable's row. If the wait boolean is true, the statement will wait until the row is unlocked. If the wait boolean is false, the statement will throw ObjectLockedException if the given object is already locked by another datastore connection. If the wait boolean is true, the statement may throw a DeadlockDetectedException.

Supported API: false

Specified by:
lock in interface PersistenceManagerSvr
Parameters:
obj -
wait -
Throws:
WTException

lock

public void lock(Persistable obj,
                 int retry,
                 int sleepIntervalSeconds)
          throws WTException
Performs a database lock on the given Persistable's row. If the given object is locked by another datastore connection, this thread will sleep for the given sleepIntervalSeconds and will retry the given number of times. If the object is still locked after retrying, an ObjectLockedException will be thrown.

Supported API: false

Specified by:
lock in interface PersistenceManagerSvr
Parameters:
obj -
retry -
sleepIntervalSeconds -
Throws:
WTException

copyLink

public BinaryLink copyLink(BinaryLink linkToCopy,
                           Persistable roleObject,
                           String roleObjectRole,
                           Persistable otherRoleObject)
                    throws WTException,
                           InvalidRoleException
Copies a link by duplicating it, replacing the role members, and persisting the new link using a server-side insert. A COPY_LINK event is then sent with the eventTarget (or target) set to the original link (the linkToCopy) and the associatedLink set to the newly persisted link.

Supported API: false

Specified by:
copyLink in interface PersistenceManagerSvr
Parameters:
linkToCopy - The original link to copy.
roleObject - The object on the "roleObjectRole" side to assign. If left null, the "linkToCopy"'s role object is not replaced.
roleObjectRole - The role the "roleObject" plays in the association.
otherRoleObject - The object on the other side of the "roleObjectRole" side to assign. If left null, the "linkToCopy"'s other side role object is not replaced.
Returns:
BinaryLink
Throws:
WTException
InvalidRoleException

query

public QueryResult query(StatementSpec a_statementSpec)
                  throws WTException
Retrieves persistable objects from the datastore given the specified statement. This method provides low level access to the database and bypasses access control operations.

Supported API: true

Specified by:
query in interface PersistenceManagerSvr
Parameters:
a_statementSpec - The statement instance specifying the query to execute.
Returns:
QueryResult
Throws:
WTException

restore

public Persistable restore(Persistable obj,
                           boolean fullRestore,
                           boolean inPlace)
                    throws WTException,
                           ObjectNoLongerExistsException
Retrieves the given Persistable object from the database to restore its state. This method provides low level access to the database and bypasses access control operations.

Supported API: false

Specified by:
restore in interface PersistenceManagerSvr
Parameters:
obj -
fullRestore - Set to true if the object references for the target object should be refreshed as well.
inPlace - Set to true if the target object should be refreshed in place.
Returns:
Persistable
Throws:
WTException
ObjectNoLongerExistsException
See Also:
In-place restore

restore

public Persistable restore(Persistable obj,
                           boolean fullRestore,
                           boolean inPlace,
                           boolean checkFreshness)
                    throws WTException,
                           ObjectNoLongerExistsException
Retrieves the given Persistable object from the database to restore its state. Refreshing object references for the target object, refreshing the object in place, and checking the object for freshness are all options controlled by boolean parameters. This method provides low level access to the database and bypasses access control operations.

Supported API: false

Specified by:
restore in interface PersistenceManagerSvr
Parameters:
obj -
fullRestore - Set to true if the object references for the target object should be refreshed as well.
inPlace - Set to true if the target object should be refreshed in place.
checkFreshness - Set to true if the target object should be checked for freshness to determine whether it is an expired or stale proxy.
Returns:
Persistable
Throws:
WTException
ObjectNoLongerExistsException
See Also:
In-place restore

insert

public void insert(Persistable obj,
                   Timestamp createDate,
                   Timestamp modifyDate)
            throws WTException
Stores the given Persistable object into the datastore. A transaction is started if one does not already exist. This method provides low level access to the database and bypasses access control operations. The object's initial creation and modification timestamps are explicitly set to the specified values.

Supported API: false

Specified by:
insert in interface PersistenceManagerSvr
Parameters:
obj - The object to be inserted into the datastore
createDate -
modifyDate -
Throws:
WTException

store

public Persistable store(Persistable obj,
                         Timestamp createDate,
                         Timestamp modifyDate)
                  throws WTException
Stores the given Persistable object in the datastore with the given timestamps. The store method ensures that the operation is valid before storing the Persistable object in the datastore.

Supported API: true

Specified by:
store in interface PersistenceManagerSvr
Parameters:
obj -
createDate -
modifyDate -
Returns:
Persistable
Throws:
WTException

query

public void query(StatementSpec a_statementSpec,
                  ResultProcessor a_resultProcessor)
           throws WTException
Retrieves persistable objects from the datastore for the specified statement. The objects are returned via the specified ResultProcessor. This method provides low level access to the database and bypasses access control operations.

Supported API: true

Specified by:
query in interface PersistenceManagerSvr
Parameters:
a_statementSpec -
a_resultProcessor -
Throws:
WTException

query

public QueryResult query(StatementSpec a_statementSpec,
                         AccessControllerProcessor a_accessControllerProcessor)
                  throws WTException


Supported API: false

Specified by:
query in interface PersistenceManagerSvr
Parameters:
a_statementSpec -
a_accessControllerProcessor -
Returns:
QueryResult
Throws:
WTException

lock

public void lock(Object a_class)
          throws WTException
Performs a database lock on the given class table. The statement may throw a DeadlockDetectedException.

Supported API: false

Specified by:
lock in interface PersistenceManagerSvr
Parameters:
a_class - The String representation of class name or Class
Throws:
WTException

restore

public Persistable restore(Persistable obj,
                           boolean fullRestore,
                           boolean inPlace,
                           boolean checkFreshness,
                           boolean lock)
                    throws WTException,
                           ObjectNoLongerExistsException
Retrieves the given Persistable object from the database to restore its state. Refreshing object references for the target object, refreshing the object in place, checking the object for freshness, and locking the object are all options controlled by boolean parameters. This method provides low level access to the database and bypasses access control operations.

Supported API: false

Specified by:
restore in interface PersistenceManagerSvr
Parameters:
obj -
fullRestore - Set to true if the object references for the target object should be refreshed as well.
inPlace - Set to true if the target object should be refreshed in place.
checkFreshness - Set to true if the target object should be checked for freshness to determine whether it is an expired or stale proxy.
lock - Specifies whether the object should be locked as part of the restore.
Returns:
Persistable
Throws:
WTException
ObjectNoLongerExistsException
See Also:
In-place restore

execute

public int execute(AbstractBatchSpec a_batchSpec)
            throws WTException
This method executes a batch update or delete operation on the specified Batch Specification.

Supported API: true

Specified by:
execute in interface PersistenceManagerSvr
Parameters:
a_batchSpec - Batch Specification to execute.
Returns:
int
Throws:
WTException

insert

public void insert(WTCollection a_objects)
            throws WTException
Stores the given Persistable object into the datastore. A transaction is started if one does not already exist. This method provides low level access to the database and bypasses access control operations.

Supported API: false

Specified by:
insert in interface PersistenceManagerSvr
Parameters:
a_objects - The objects to be inserted into the datastore. The collection should contain full Persistable objects.
Throws:
WTException

update

public void update(WTCollection a_objects)
            throws WTException
Updates the specified objects in the datastore. The collection is assumed to contain full Persistable objects. A transaction is started if one does not already exist. This method provides low level access to the database and bypasses access control operations.

Supported API: false

Specified by:
update in interface PersistenceManagerSvr
Parameters:
a_objects - Objects to update in the datastore.
Throws:
WTException

remove

public void remove(WTSet a_objects)
            throws WTException
Removes the specified objects from the datastore. A transaction is started if one does not already exist. This method provides low level access to the database and bypasses access control operations.

Supported API: false

Specified by:
remove in interface PersistenceManagerSvr
Parameters:
a_objects - Objects to remove from the datastore.
Throws:
WTException

copyLink

public WTValuedHashMap copyLink(WTValuedHashMap linksToCopy)
                         throws WTException
Copies links in the specified Map for each key (original copy) by persisting the associated value (new link) using a server-side insert. A mulit-object COPY_LINK event is then dispatched with the Map as the eventTarget. The PersistenceServerHelper contains methods for assistance in building the copy-link Map.

Supported API: false

Specified by:
copyLink in interface PersistenceManagerSvr
Parameters:
linksToCopy - Map of original link objects (keys) and associated new link objects (values).
Returns:
WTValuedHashMap
Throws:
WTException
See Also:
PersistenceServerHelper.newCopyLink(BinaryLink,Persistable,String,Persistable), PersistenceServerHelper.buildCopyLinkMap(WTList,WTList,List,WTList)

update

public void update(WTCollection a_objects,
                   boolean changeModifyDate)
            throws WTException
Updates the specified objects in the datastore. The collection is assumed to contain full Persistable objects. A transaction is started if one does not already exist. This method provides low level access to the database and bypasses access control operations.

Supported API: false

Specified by:
update in interface PersistenceManagerSvr
Parameters:
a_objects - Objects to update in the datastore.
changeModifyDate - Set to true if the modifyTimestamp is to be updated.
Throws:
WTException

restore

public Persistable restore(ObjectIdentifier objId,
                           boolean checkFreshness,
                           boolean lock)
                    throws WTException,
                           ObjectNoLongerExistsException
Retrieves a Persistable object from the database given its object identifier. Object references for the target object are not refreshed. This method provides low level access to the database and bypasses access control operations.

Supported API: false

Specified by:
restore in interface PersistenceManagerSvr
Parameters:
objId - The object identifier of the persistable object to be restored
checkFreshness - Set to true if the target object should be checked for freshness to determine whether it is an expired or stale proxy.
lock -
Returns:
Persistable
Throws:
WTException
ObjectNoLongerExistsException

query

public void query(StatementSpec a_statementSpec,
                  AccessControllerProcessor a_accessControllerProcessor,
                  ResultProcessor a_resultProcessor)
           throws WTException
This method queries the persistent datastore.

Supported API: false

Specified by:
query in interface PersistenceManagerSvr
Parameters:
a_statementSpec - Statement to use for the query.
a_accessControllerProcessor - Access Control to apply to the results.
a_resultProcessor - Processes the results of the query.
Throws:
WTException

_query

private QueryResult _query(StatementSpec a_statementSpec,
                           AccessControllerProcessor a_accessControllerProcessor,
                           ResultProcessor a_resultProcessor)
                    throws WTException
Throws:
WTException

_find

private QueryResult _find(StatementSpec a_statementSpec,
                          ResultProcessor a_resultProcessor)
                   throws WTException
Throws:
WTException

checkOperation

private void checkOperation(WTCollection a_objects,
                            int a_operation,
                            boolean a_checkAttributes)
                     throws WTException
Ensure that it is valid to perform the specified operation on the specified persistable objects in the datastore.

Throws:
WTException

remove

private void remove(ClassInfo a_targetClass,
                    WTSet a_objects,
                    boolean a_checkUpdateCount,
                    HashSet a_recursiveOwnerSet,
                    WTSet a_candidateObjects)
             throws WTException
Removes the given persistables from the datastore.

Supported API: false

Parameters:
a_targetClass - Class for the objects to remove from the datastore.
a_objects - Objects to remove from the datastore.
a_checkUpdateCount - indicates if update count checking is required.
a_candidateObjects - Objects that will be removed from the as part of this operation. This is needed for foreignkey remove optimization and to skip removal of objects that were found via recursive processing if they are already candidates (e.g. they were specified in the top-level set of objects passed to remove).
Throws:
WTException

processRemoveOids

private void processRemoveOids(ClassInfo a_targetClassInfo,
                               OidArray a_oidArray,
                               int a_targetOidColumnIndex,
                               int a_sourceOidColumnIndex,
                               HashSet a_deletedPersistableSet,
                               HashSet a_recursiveOwnerSet,
                               WTSet a_candidateObjects)
                        throws WTException
Processes OIDs that are to be removed from the datastore as a result of referential integrity processing.

Supported API: false

Parameters:
a_targetClassInfo - ClassInfo for the objects to remove from the datastore.
a_oidArray - ObjectIdentifier information for the objects to remove from the datastore.
a_targetOidColumnIndex - specifies the index in the a_oidArray for the target of the processing.
a_sourceOidColumnIndex - specifies the index in the a_oidArray for the source of the processing.
a_deletedPersistableSet - specifies the current set of objects that have already been removed during this transaction.
a_candidateObjects - Objects that will be removed from the as part of this operation. This is needed for foreignkey remove optimization and to skip removal of objects that were found via recursive processing if they are already candidates (e.g. they were specified in the top-level set of objects passed to remove).
Throws:
WTException

removeBatch

private int removeBatch(ClassInfo a_targetClass,
                        WTSet a_objects,
                        boolean a_checkUpdateCount,
                        WTSet a_candidateObjects,
                        Set a_deletedPersistableSet)
                 throws WTException
This method removes the specified objects optionally checking to ensure that update counts match. /** Processes OIDs that are to be removed from the datastore as a result of referential integrity processing.

Supported API: false

Parameters:
a_targetClass - Class for the objects to remove from the datastore.
a_objects - Objects to remove from the datastore.
a_checkUpdateCount - indicates if update count checking is required.
a_candidateObjects - Objects that will be removed from the as part of this operation. This is needed for foreignkey remove optimization and to skip removal of objects that were found via recursive processing if they are already candidates (e.g. they were specified in the top-level set of objects passed to remove).
a_deletedPersistableSet - specifies the current set of objects that have already been removed during this transaction.
Throws:
WTException

filter

private static WTSet filter(WTSet a_objects,
                            Set a_filterSet)
                     throws WTException
This method filters Persistable objects that have already been removed. If an object is to be filterd from a set, then a copy of the set is made before removing the object.

Parameters:
a_objects - set of objects to filter
a_filterSet - set of objects to remove from the filter set
Throws:
WTException

queryOwnedLinks

private ObjectSetVector queryOwnedLinks(ClassInfo a_targetClassInfo,
                                        WTSet a_objects,
                                        List a_list)
                                 throws WTException
This method builds and executes a query to return all of the links that are owned by the specified objects. The specified list of RoleDescriptors contains only roles that are owned by the objects's class.

Parameters:
a_targetClassInfo - target of the link query
a_objects - set of source role objects to query for
a_list - contains RoleDescriptors to query for
Throws:
WTException

queryCascadeRoles

private QueryResult queryCascadeRoles(WTSet a_objects,
                                      Map a_map)
                               throws WTException
This method builds and executes a query to return all of the role objects that the remove should cascade to. The specified list of RoleDescriptors contains only roles that should cascade to role objects. The query should exclude any classes that are handled by the datastore. If a role's valid class is not a remove event participant, then it should not be queried for. However, the valid role class may have a sub-class that is a remove event participant so that sub-class (and all of its sub-classes should be queried for.

Parameters:
a_objects - set of source role objects to query for
a_map - contains RoleDescriptors and associated valid classes
Throws:
WTException

dispatchVetoableEvent

private void dispatchVetoableEvent(String a_eventType,
                                   Persistable a_obj)
                            throws WTException
Throws:
WTException

dispatchVetoableEvent

private void dispatchVetoableEvent(String a_eventType,
                                   WTCollection a_objs)
                            throws WTException
Throws:
WTException

dispatchVetoableEvent

private void dispatchVetoableEvent(PersistenceManagerEvent a_event,
                                   boolean a_single)
                            throws WTException
Throws:
WTException

savePersistInfoState

static ArrayList savePersistInfoState(WTCollection a_objs)
                               throws WTException
Throws:
WTException

resetPersistInfoState

static void resetPersistInfoState(Object a_persistInfoState)

expand

public QueryResult expand(Persistable obj,
                          String role,
                          Class linkClass,
                          boolean onlyOtherSide,
                          boolean a_sorted)
                   throws WTException
Retrieves objects related to the given persistable object given a role and link class. This method provides low level access to the database and bypasses access control operations.

Supported API: false

Parameters:
obj - The persistable object to navigate
role - The role to navigate to
linkClass - The link class to navigate
onlyOtherSide -
a_sorted -
Returns:
QueryResult
Throws:
WTException

expand

private QueryResult expand(Persistable obj,
                           String role,
                           Class linkClass,
                           boolean onlyOtherSide,
                           AccessControllerProcessor a_accessControllerProcessor,
                           boolean a_sorted)
                    throws WTException
Retrieves objects related to the given persistable object given a role and link class. This method provides low level access to the database and bypasses access control operations.

Supported API: false

Parameters:
obj - The persistable object to navigate
role - The role to navigate to
linkClass - The link class to navigate
onlyOtherSide -
a_sorted - sorted TRUE
Returns:
QueryResult
Throws:
WTException

expand

private QueryResult expand(Persistable obj,
                           String role,
                           QuerySpec criteria,
                           boolean onlyOtherSide,
                           AccessControllerProcessor a_accessControllerProcessor)
                    throws WTException
Retrieves objects related to the given persistable object given a role, an association name and selection criteria. This method provides low level access to the database and bypasses access control operations.

Supported API: false

Parameters:
obj - The persistable object to navigate
role - The role to navigate to
criteria - Selection criteria for the navigate
onlyOtherSide -
Returns:
QueryResult
Throws:
WTException

makeQuerySpec

private QuerySpec makeQuerySpec(Class targetLinkClass,
                                Persistable obj1,
                                String obj1Role,
                                Persistable obj2)
                         throws WTException
Make a QuerySpec for all link objects that exist between two Persistable objects.

Parameters:
targetLinkClass -
obj1 -
obj1Role -
obj2 -
Returns:
QueryResult
Throws:
WTException

makeQuerySpec

private QuerySpec makeQuerySpec(Class targetLinkClass,
                                ObjectIdentifier obj1Oid,
                                String obj1Role,
                                ObjectIdentifier obj2Oid)
                         throws WTException,
                                InvalidRoleException
Make a QuerySpec for all link objects that exist between two Persistable objects given their object identifiers.

Parameters:
targetLinkClass -
obj1Oid -
obj1Role -
obj2Oid -
Returns:
QueryResult
Throws:
WTException
InvalidRoleException

requiresInflate

public static boolean requiresInflate(String package_name,
                                      Vector display_attributes)

getPagingSessionCache

public static PagingSessionCache getPagingSessionCache()

buildFailedCollection

private WTCollection buildFailedCollection(WTCollection a_objects,
                                           boolean a_insertOperation)

updatePagingSessionCache

private static void updatePagingSessionCache(PagingSession pagingSession)

validateCollection

private static void validateCollection(WTCollection a_objects,
                                       boolean a_lock)
                                throws WTException
Throws:
WTException