|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.services.StandardManager
wt.fc.StandardPersistenceManager
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
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static final String RESOURCE
private static final String CLASSNAME
public static final boolean DEBUG
private static final DebugWriter LOG
private static final AccessController NOOP_ACCESS_CONTROLLER
private static final AccessController STANDARD_ACCESS_CONTROLLER
private static final AccessControllerProcessor STANDARD_NOOP_AC_PROCESSOR
private static final AccessControllerProcessor STANDARD_AC_PROCESSOR
private static PagingSessionCache pagingSessionCache
private KeyedEventListener listener
private static final RefreshSpec PREPARE_FOR_MODIFICATION_DEFAULT
private static final String EMPTY_COLLECTION_ASSERT_MESSAGE
static Boolean propExecuteQueues
private static final Object REFERENTIAL_INTEGRITY_VALIDATOR_KEY
private static final Object DELETED_PERSISTABLE_SET_KEY
private static final int CHECK_STORE
private static final int CHECK_MODIFY
private static final int CHECK_DELETE
Constructor Detail |
public StandardPersistenceManager()
Method Detail |
public String getConceptualClassname()
getConceptualClassname
in interface NetFactor
getConceptualClassname
in class StandardManager
protected void checkStore(Persistable obj) throws WTException
obj
- The persistable object that needs to be validated before it is stored in the datastore.
WTException
protected void checkDelete(Persistable obj) throws WTException
obj
- The persistable object that needs to be validated before it is deleted from the datastore.
WTException
protected void checkModify(Persistable obj) throws WTException
obj
- The persistable object that needs to be validated before it is modified in the datastore.
WTException
public void registerEvents(ManagerService ms)
registerEvents
in interface Manager
registerEvents
in class StandardManager
ms
- the ManagerService with which to register eventsprotected void performStartupProcess() throws ManagerException
performStartupProcess
in class StandardManager
ManagerException
public static StandardPersistenceManager newStandardPersistenceManager() throws WTException
WTException
public Persistable delete(Persistable obj) throws WTException
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.
PersistenceManagerEvent.PRE_DELETE
event.
Persistable.checkAttributes()
).
BinaryLink
objects that are owned
by the role object that is being deleted.
PersistenceManagerEvent.CLEANUP_LINK
event.
PersistenceManagerEvent.PRE_REMOVE
event.
PersistenceManagerEvent.REMOVE
event.
BinaryLink
, then any cascaded
role objects are deleted.
PersistenceManagerEvent.POST_DELETE
event.
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.
delete
in interface PersistenceManager
obj
- The object to be deleted from the datastore.
WTException
public QueryResult find(QuerySpec criteria) throws WTException
find
in interface PersistenceManager
criteria
- The search criteria to use for the find
WTException
public QueryResult find(Class targetLinkClass, Persistable obj1, String obj1Role, Persistable obj2) throws WTException
find
in interface PersistenceManager
targetLinkClass
- obj1
- obj1Role
- obj2
-
WTException
public QueryResult find(Class targetLinkClass, ObjectIdentifier obj1Oid, String obj1Role, ObjectIdentifier obj2Oid) throws WTException, InvalidRoleException
find
in interface PersistenceManager
targetLinkClass
- obj1Oid
- obj1Role
- obj2Oid
-
WTException
InvalidRoleException
public InputStream getLob(LobLocator lob) throws WTException
getLob
in interface PersistenceManager
lob
- the Lob locator.
WTException
public Persistable modify(Persistable obj) throws WTException
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.
PersistenceManagerEvent.PRE_MODIFY
event.
Persistable.checkAttributes()
).
PersistenceManagerEvent.UPDATE
event.
PersistenceManagerEvent.POST_MODIFY
event.
modify
in interface PersistenceManager
obj
- The object to be modified in the datastore
WTException
public QueryResult navigate(Persistable obj, String role, Class linkClass) throws WTException
navigate
in interface PersistenceManager
obj
- The persistable object to navigate.role
- The role to navigate tolinkClass
- The link class to navigate
WTException
public QueryResult navigate(Persistable obj, String role, Class linkClass, boolean onlyOtherSide) throws WTException
navigate
in interface PersistenceManager
obj
- role
- linkClass
- The link class for the association to navigateonlyOtherSide
- 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).
WTException
public QueryResult navigate(Persistable obj, String role, QuerySpec criteria) throws WTException
navigate
in interface PersistenceManager
obj
- The persistable object to navigaterole
- The role to navigate tocriteria
- Selection criteria for the navigate. This QuerySpec must contain the target and link class at class index 0 and 1, respectively.
WTException
public QueryResult navigate(Persistable obj, String role, QuerySpec criteria, boolean onlyOtherSide) throws WTException
navigate
in interface PersistenceManager
obj
- The persistable object to navigaterole
- The role to navigate tocriteria
- 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).
WTException
public Persistable refresh(Persistable obj, boolean fullRefresh) throws WTException, ObjectNoLongerExistsException
refresh
in interface PersistenceManager
obj
- The persistable object to be refreshedfullRefresh
- Set to true if the object references for the target object should be refreshed as well.
WTException
ObjectNoLongerExistsException
public Persistable refresh(Persistable obj) throws WTException, ObjectNoLongerExistsException
refresh
in interface PersistenceManager
obj
- The persistable object to be refreshed
WTException
ObjectNoLongerExistsException
public Persistable refresh(ObjectIdentifier objId) throws WTException, ObjectNoLongerExistsException
refresh
in interface PersistenceManager
objId
-
WTException
ObjectNoLongerExistsException
public Persistable save(Persistable obj) throws WTException
save
in interface PersistenceManager
obj
- The persistable object to be saved
WTException
public Persistable store(Persistable obj) throws WTException
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.
PersistenceManagerEvent.PRE_STORE
event.
Persistable.checkAttributes()
).
PersistenceManagerEvent.INSERT
event.
PersistenceManagerEvent.POST_STORE
event.
store
in interface PersistenceManager
obj
- The object to be stored in the datastore
WTException
public Persistable modify(Persistable obj, String attrName, ObjectMappable objAttr) throws WTException
modify
in interface PersistenceManager
obj
- attrName
- objAttr
-
WTException
public Persistable prepareForModification(Persistable obj) throws ModificationNotAllowedException, ObjectNoLongerExistsException, NotAuthorizedException, WTException
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
prepareForModification
in interface PersistenceManager
obj
-
ModificationNotAllowedException
ObjectNoLongerExistsException
NotAuthorizedException
WTException
public String getNextSequence(String sequenceName) throws WTException
getNextSequence
in interface PersistenceManager
sequenceName
-
WTException
public Persistable prepareForView(Persistable obj) throws ObjectNoLongerExistsException, NotAuthorizedException, WTException
The method throws the NotAuthorizedException if the user is not allowed
to view the given object.
Supported API: false
prepareForView
in interface PersistenceManager
obj
-
ObjectNoLongerExistsException
NotAuthorizedException
WTException
public void inflate(QueryResult queryResult, Vector displayAttributes) throws WTException
inflate
in interface PersistenceManager
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.
WTException
public Persistable prepareForModification(WTReference objRef) throws ModificationNotAllowedException, ObjectNoLongerExistsException, NotAuthorizedException, WTException
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
prepareForModification
in interface PersistenceManager
objRef
-
ModificationNotAllowedException
ObjectNoLongerExistsException
NotAuthorizedException
WTException
public Persistable prepareForView(WTReference objRef) throws ObjectNoLongerExistsException, NotAuthorizedException, WTException
The method throws the NotAuthorizedException if the user is not allowed
to view the given object.
Supported API: false
prepareForView
in interface PersistenceManager
objRef
-
ObjectNoLongerExistsException
NotAuthorizedException
WTException
public QueryResult find(StatementSpec a_statementSpec) throws WTException
find
in interface PersistenceManager
a_statementSpec
- The search criteria to use for the find
WTException
public Persistable refresh(Persistable obj, boolean fullRefresh, boolean inPlace) throws WTException, ObjectNoLongerExistsException
refresh
in interface PersistenceManager
obj
- The persistable object to be refreshedfullRefresh
- 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.
WTException
ObjectNoLongerExistsException
public ResultProcessor find(StatementSpec a_statementSpec, ResultProcessor a_resultProcessor) throws WTException
find
in interface PersistenceManager
a_statementSpec
- a_resultProcessor
-
WTException
public Persistable refresh(Persistable obj, boolean fullRefresh, boolean inPlace, boolean lock) throws WTException, ObjectNoLongerExistsException
refresh
in interface PersistenceManager
obj
- The persistable object to be refreshedfullRefresh
- 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.
WTException
ObjectNoLongerExistsException
public Persistable lockAndRefresh(Persistable obj) throws WTException
lockAndRefresh
in interface PersistenceManager
obj
- The persistable object to be refreshed
WTException
public WTCollection store(WTCollection a_objects) throws WTException
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.
PersistenceManagerEvent.PRE_STORE
event.
Persistable.checkAttributes()
for each object).
PersistenceManagerEvent.INSERT
event.
PersistenceManagerEvent.POST_STORE
event.
store
in interface PersistenceManager
a_objects
- The objects to be stored in the datastore
WTException
public WTCollection modify(WTCollection a_objects) throws WTException
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.
PersistenceManagerEvent.PRE_MODIFY
event.
Persistable.checkAttributes()
for each object).
PersistenceManagerEvent.UPDATE
event.
PersistenceManagerEvent.POST_MODIFY
event.
modify
in interface PersistenceManager
a_objects
- The objects to be modified in the datastore
WTException
public WTSet delete(WTSet a_objects) throws WTException
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.
PersistenceManagerEvent.PRE_DELETE
event.
Persistable.checkAttributes()
for each object).
BinaryLink
objects that are owned
by the role objects that are being deleted.
PersistenceManagerEvent.CLEANUP_LINK
event.
PersistenceManagerEvent.PRE_REMOVE
event.
PersistenceManagerEvent.REMOVE
event.
BinaryLink
, cascaded
role objects are deleted.
PersistenceManagerEvent.POST_DELETE
event.
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.
delete
in interface PersistenceManager
a_objects
- The objects to be deleted from the datastore.
WTException
public WTCollection prepareForModification(WTCollection a_objects) throws ModificationNotAllowedException, NotAuthorizedException, WTException
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
prepareForModification
in interface PersistenceManager
a_objects
- The objects to be modified in the datastore
ModificationNotAllowedException
NotAuthorizedException
WTException
public WTCollection save(WTCollection objects) throws WTException
save
in interface PersistenceManager
objects
- The persistable objects to be saved
WTException
public String getNextSequence(Class a_class) throws WTException
getNextSequence
in interface PersistenceManager
a_class
-
WTException
public Persistable refresh(ObjectIdentifier objId, boolean lock) throws WTException, ObjectNoLongerExistsException
refresh
in interface PersistenceManager
objId
- lock
-
WTException
ObjectNoLongerExistsException
public QueryResult expand(Persistable obj, String role, Class linkClass, boolean onlyOtherSide) throws WTException
expand
in interface PersistenceManagerSvr
obj
- The persistable object to navigaterole
- The role to navigate tolinkClass
- The link class to navigateonlyOtherSide
-
WTException
public QueryResult expand(Persistable obj, String role, QuerySpec criteria, boolean onlyOtherSide) throws WTException
expand
in interface PersistenceManagerSvr
obj
- The persistable object to navigaterole
- The role to navigate tocriteria
- Selection criteria for the navigate. This QuerySpec must contain the target and link class at class index 0 and 1, respectively.onlyOtherSide
-
WTException
public void insert(Persistable obj) throws WTException
insert
in interface PersistenceManagerSvr
obj
- The object to be inserted into the datastore
WTException
public QueryResult query(QuerySpec qs) throws WTException
query
in interface PersistenceManagerSvr
qs
-
WTException
public QueryResult query(Class targetLinkClass, Persistable obj1, String obj1Role, Persistable obj2) throws WTException
query
in interface PersistenceManagerSvr
targetLinkClass
- obj1
- obj1Role
- obj2
-
WTException
public QueryResult query(Class targetLinkClass, ObjectIdentifier obj1Oid, String obj1Role, ObjectIdentifier obj2Oid) throws WTException, InvalidRoleException
query
in interface PersistenceManagerSvr
targetLinkClass
- obj1Oid
- obj1Role
- obj2Oid
-
WTException
InvalidRoleException
public void remove(Persistable obj) throws WTException
remove
in interface PersistenceManagerSvr
obj
-
WTException
public Persistable restore(Persistable obj, boolean fullRestore) throws WTException, ObjectNoLongerExistsException
restore
in interface PersistenceManagerSvr
obj
- fullRestore
- Set to true if the object references for the target object should be refreshed as well.
WTException
ObjectNoLongerExistsException
public Persistable restore(Persistable obj) throws WTException, ObjectNoLongerExistsException
restore
in interface PersistenceManagerSvr
obj
-
WTException
ObjectNoLongerExistsException
public Persistable restore(ObjectIdentifier objId) throws WTException, ObjectNoLongerExistsException
restore
in interface PersistenceManagerSvr
objId
- The object identifier of the persistable object to be restored
WTException
ObjectNoLongerExistsException
public Persistable restore(ObjectIdentifier objId, boolean checkFreshness) throws WTException, ObjectNoLongerExistsException
restore
in interface PersistenceManagerSvr
objId
- The object identifier of the persistable object to be restoredcheckFreshness
- Set to true if the target object should be checked for freshness to determine whether it is an expired or stale proxy.
WTException
ObjectNoLongerExistsException
public void update(Persistable obj) throws WTException
update
in interface PersistenceManagerSvr
obj
-
WTException
public void update(Persistable obj, boolean changeModifyDate) throws WTException
update
in interface PersistenceManagerSvr
obj
- The object to be modifiedchangeModifyDate
- Set to true if the modifyTimestamp is to be updated.
WTException
public void update(Persistable obj, String attrName, ObjectMappable objAttr) throws WTException
update
in interface PersistenceManagerSvr
obj
- attrName
- objAttr
-
WTException
public void updateLob(Persistable obj, LobLocator lob, InputStream stream, long length, boolean changeModifyDate) throws WTException
updateLob
in interface PersistenceManagerSvr
obj
- lob
- stream
- length
- changeModifyDate
-
WTException
public long updateLob(Persistable obj, LobLocator lob, InputStream stream, boolean changeModifyDate) throws WTException
updateLob
in interface PersistenceManagerSvr
obj
- lob
- stream
- changeModifyDate
-
WTException
public void lock(Persistable obj) throws WTException
lock
in interface PersistenceManagerSvr
obj
-
WTException
public void lock(Persistable obj, boolean wait) throws WTException
lock
in interface PersistenceManagerSvr
obj
- wait
-
WTException
public void lock(Persistable obj, int retry, int sleepIntervalSeconds) throws WTException
lock
in interface PersistenceManagerSvr
obj
- retry
- sleepIntervalSeconds
-
WTException
public BinaryLink copyLink(BinaryLink linkToCopy, Persistable roleObject, String roleObjectRole, Persistable otherRoleObject) throws WTException, InvalidRoleException
copyLink
in interface PersistenceManagerSvr
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.
WTException
InvalidRoleException
public QueryResult query(StatementSpec a_statementSpec) throws WTException
query
in interface PersistenceManagerSvr
a_statementSpec
- The statement instance specifying the query to execute.
WTException
public Persistable restore(Persistable obj, boolean fullRestore, boolean inPlace) throws WTException, ObjectNoLongerExistsException
restore
in interface PersistenceManagerSvr
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.
WTException
ObjectNoLongerExistsException
public Persistable restore(Persistable obj, boolean fullRestore, boolean inPlace, boolean checkFreshness) throws WTException, ObjectNoLongerExistsException
restore
in interface PersistenceManagerSvr
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.
WTException
ObjectNoLongerExistsException
public void insert(Persistable obj, Timestamp createDate, Timestamp modifyDate) throws WTException
insert
in interface PersistenceManagerSvr
obj
- The object to be inserted into the datastorecreateDate
- modifyDate
-
WTException
public Persistable store(Persistable obj, Timestamp createDate, Timestamp modifyDate) throws WTException
store
in interface PersistenceManagerSvr
obj
- createDate
- modifyDate
-
WTException
public void query(StatementSpec a_statementSpec, ResultProcessor a_resultProcessor) throws WTException
query
in interface PersistenceManagerSvr
a_statementSpec
- a_resultProcessor
-
WTException
public QueryResult query(StatementSpec a_statementSpec, AccessControllerProcessor a_accessControllerProcessor) throws WTException
query
in interface PersistenceManagerSvr
a_statementSpec
- a_accessControllerProcessor
-
WTException
public void lock(Object a_class) throws WTException
lock
in interface PersistenceManagerSvr
a_class
- The String representation of class name or Class
WTException
public Persistable restore(Persistable obj, boolean fullRestore, boolean inPlace, boolean checkFreshness, boolean lock) throws WTException, ObjectNoLongerExistsException
restore
in interface PersistenceManagerSvr
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.
WTException
ObjectNoLongerExistsException
public int execute(AbstractBatchSpec a_batchSpec) throws WTException
execute
in interface PersistenceManagerSvr
a_batchSpec
- Batch Specification to execute.
WTException
public void insert(WTCollection a_objects) throws WTException
insert
in interface PersistenceManagerSvr
a_objects
- The objects to be inserted into the datastore. The collection should contain full Persistable objects.
WTException
public void update(WTCollection a_objects) throws WTException
update
in interface PersistenceManagerSvr
a_objects
- Objects to update in the datastore.
WTException
public void remove(WTSet a_objects) throws WTException
remove
in interface PersistenceManagerSvr
a_objects
- Objects to remove from the datastore.
WTException
public WTValuedHashMap copyLink(WTValuedHashMap linksToCopy) throws WTException
copyLink
in interface PersistenceManagerSvr
linksToCopy
- Map of original link objects (keys) and associated new link objects (values).
WTException
PersistenceServerHelper.newCopyLink(BinaryLink,Persistable,String,Persistable)
,
PersistenceServerHelper.buildCopyLinkMap(WTList,WTList,List,WTList)
public void update(WTCollection a_objects, boolean changeModifyDate) throws WTException
update
in interface PersistenceManagerSvr
a_objects
- Objects to update in the datastore.changeModifyDate
- Set to true if the modifyTimestamp is to be updated.
WTException
public Persistable restore(ObjectIdentifier objId, boolean checkFreshness, boolean lock) throws WTException, ObjectNoLongerExistsException
restore
in interface PersistenceManagerSvr
objId
- The object identifier of the persistable object to be restoredcheckFreshness
- Set to true if the target object should be checked for freshness to determine whether it is an expired or stale proxy.lock
-
WTException
ObjectNoLongerExistsException
public void query(StatementSpec a_statementSpec, AccessControllerProcessor a_accessControllerProcessor, ResultProcessor a_resultProcessor) throws WTException
query
in interface PersistenceManagerSvr
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.
WTException
private QueryResult _query(StatementSpec a_statementSpec, AccessControllerProcessor a_accessControllerProcessor, ResultProcessor a_resultProcessor) throws WTException
WTException
private QueryResult _find(StatementSpec a_statementSpec, ResultProcessor a_resultProcessor) throws WTException
WTException
private void checkOperation(WTCollection a_objects, int a_operation, boolean a_checkAttributes) throws WTException
WTException
private void remove(ClassInfo a_targetClass, WTSet a_objects, boolean a_checkUpdateCount, HashSet a_recursiveOwnerSet, WTSet a_candidateObjects) throws WTException
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).
WTException
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
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).
WTException
private int removeBatch(ClassInfo a_targetClass, WTSet a_objects, boolean a_checkUpdateCount, WTSet a_candidateObjects, Set a_deletedPersistableSet) throws WTException
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.
WTException
private static WTSet filter(WTSet a_objects, Set a_filterSet) throws WTException
a_objects
- set of objects to filtera_filterSet
- set of objects to remove from the filter set
WTException
private ObjectSetVector queryOwnedLinks(ClassInfo a_targetClassInfo, WTSet a_objects, List a_list) throws WTException
a_targetClassInfo
- target of the link querya_objects
- set of source role objects to query fora_list
- contains RoleDescriptors to query for
WTException
private QueryResult queryCascadeRoles(WTSet a_objects, Map a_map) throws WTException
a_objects
- set of source role objects to query fora_map
- contains RoleDescriptors and associated valid classes
WTException
private void dispatchVetoableEvent(String a_eventType, Persistable a_obj) throws WTException
WTException
private void dispatchVetoableEvent(String a_eventType, WTCollection a_objs) throws WTException
WTException
private void dispatchVetoableEvent(PersistenceManagerEvent a_event, boolean a_single) throws WTException
WTException
static ArrayList savePersistInfoState(WTCollection a_objs) throws WTException
WTException
static void resetPersistInfoState(Object a_persistInfoState)
public QueryResult expand(Persistable obj, String role, Class linkClass, boolean onlyOtherSide, boolean a_sorted) throws WTException
obj
- The persistable object to navigaterole
- The role to navigate tolinkClass
- The link class to navigateonlyOtherSide
- a_sorted
-
WTException
private QueryResult expand(Persistable obj, String role, Class linkClass, boolean onlyOtherSide, AccessControllerProcessor a_accessControllerProcessor, boolean a_sorted) throws WTException
obj
- The persistable object to navigaterole
- The role to navigate tolinkClass
- The link class to navigateonlyOtherSide
- a_sorted
- sorted TRUE
WTException
private QueryResult expand(Persistable obj, String role, QuerySpec criteria, boolean onlyOtherSide, AccessControllerProcessor a_accessControllerProcessor) throws WTException
obj
- The persistable object to navigaterole
- The role to navigate tocriteria
- Selection criteria for the navigateonlyOtherSide
-
WTException
private QuerySpec makeQuerySpec(Class targetLinkClass, Persistable obj1, String obj1Role, Persistable obj2) throws WTException
targetLinkClass
- obj1
- obj1Role
- obj2
-
WTException
private QuerySpec makeQuerySpec(Class targetLinkClass, ObjectIdentifier obj1Oid, String obj1Role, ObjectIdentifier obj2Oid) throws WTException, InvalidRoleException
targetLinkClass
- obj1Oid
- obj1Role
- obj2Oid
-
WTException
InvalidRoleException
public static boolean requiresInflate(String package_name, Vector display_attributes)
public static PagingSessionCache getPagingSessionCache()
private WTCollection buildFailedCollection(WTCollection a_objects, boolean a_insertOperation)
private static void updatePagingSessionCache(PagingSession pagingSession)
private static void validateCollection(WTCollection a_objects, boolean a_lock) throws WTException
WTException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |