|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The PersistenceManager interface identifies the set of methods that applications
use to manage the persistent state of their business objects. While
all of the methods declared by this interface execute on the server,
they are accessable to client application through a helper class. See
PersistenceHelper.
Supported API: true
Extendable: false
Method Summary | |
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. |
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. |
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). |
void |
inflate(QueryResult queryResult,
Vector displayAttributes)
Emit the INFLATE_RESULT event to inflate the search results for SearchTask search. |
Persistable |
lockAndRefresh(Persistable obj)
Lock and refresh the object. |
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. |
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. |
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. |
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. |
Persistable |
store(Persistable obj)
Stores the specified Persistable object in the datastore. |
WTCollection |
store(WTCollection a_objects)
Stores the specified collection of Persistable objects in the datastore. |
Method Detail |
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.
obj
- The object to be deleted from the datastore.
WTException
public QueryResult find(QuerySpec criteria) throws WTException
criteria
- The search criteria to use for the find
WTException
public QueryResult find(Class targetLinkClass, Persistable obj1, String obj1Role, Persistable obj2) throws WTException
targetLinkClass
- obj1
- obj1Role
- obj2
-
WTException
public QueryResult find(Class targetLinkClass, ObjectIdentifier obj1Oid, String obj1Role, ObjectIdentifier obj2Oid) throws WTException, InvalidRoleException
targetLinkClass
- obj1Oid
- obj1Role
- obj2Oid
-
WTException
InvalidRoleException
public InputStream getLob(LobLocator lob) throws WTException
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.
obj
- The object to be modified in the datastore
WTException
public QueryResult navigate(Persistable obj, String role, Class linkClass) throws WTException
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
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
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
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
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
obj
- The persistable object to be refreshed
WTException
ObjectNoLongerExistsException
public Persistable refresh(ObjectIdentifier objId) throws WTException, ObjectNoLongerExistsException
objId
-
WTException
ObjectNoLongerExistsException
public Persistable save(Persistable obj) throws WTException
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.
obj
- The object to be stored in the datastore
WTException
public Persistable modify(Persistable obj, String attrName, ObjectMappable objAttr) throws WTException
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
obj
-
ModificationNotAllowedException
ObjectNoLongerExistsException
NotAuthorizedException
WTException
public String getNextSequence(String sequenceName) throws WTException
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
obj
-
ObjectNoLongerExistsException
NotAuthorizedException
WTException
public void inflate(QueryResult queryResult, Vector displayAttributes) throws WTException
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
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
objRef
-
ObjectNoLongerExistsException
NotAuthorizedException
WTException
public QueryResult find(StatementSpec a_statementSpec) throws WTException
a_statementSpec
- The search criteria to use for the find
WTException
public Persistable refresh(Persistable obj, boolean fullRefresh, boolean inPlace) throws WTException, ObjectNoLongerExistsException
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
a_statementSpec
- a_resultProcessor
-
WTException
public Persistable refresh(Persistable obj, boolean fullRefresh, boolean inPlace, boolean lock) throws WTException, ObjectNoLongerExistsException
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
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.
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.
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.
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
a_objects
- The objects to be modified in the datastore
ModificationNotAllowedException
NotAuthorizedException
WTException
public WTCollection save(WTCollection objects) throws WTException
objects
- The persistable objects to be saved
WTException
public String getNextSequence(Class a_class) throws WTException
a_class
-
WTException
public Persistable refresh(ObjectIdentifier objId, boolean lock) throws WTException, ObjectNoLongerExistsException
objId
- lock
-
WTException
ObjectNoLongerExistsException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |