|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Provider for transactional services, such as object lifecycle management.
The Factory for PersistenceManager instances is the PersistenceRuntime.
Each persistence environment has to provide an implementation of interface PersistenceManager.
The implementation must map the calls and Exceptions defined in this interface to the persistence tools implementation of a persistence manager. This is most likely done via delegation.
Only one transaction at a time may be opened with beginTransaction(). If beginTransaction() is not explicitly called, the first write operation on the PersistenceManager will start the exclusive access to the storage. Read operations without beginTransaction() are prohibited and will throw PersistenceException
After commit() or rollback() no more operations can be executed on the calling instance. You have to request another instance from the PersistenceRuntime.
All persistent operations need to be specified with a TreeOptionType. It may have following values: SKELETON: only the entity itself is written
DEPENDENT: the entity itself and dependent associated entities are written
COMPLETE_TREE: the entity itself and all associated entities are written
Method Summary | |
void |
beginTransaction(boolean doWait)
Ensures exclusive access to persistent storage. |
void |
commit()
Executes the changes on persistent storage and releases the Lock on persistence Operations for other PersistenceManagers. |
void |
delete(PersistableEntity entity,
TreeOptionType treeOption)
Deletes the given entity and dependent of the parameter treeOption the associated entities. |
void |
deleteAll(ClassDescriptor cdes,
TreeOptionType treeOption)
Deletes all Entities of the given ClassDescriptor |
boolean |
entityFactoryIsRegistered()
Checks for registered EntityFactory |
JQueryResult |
executeQuery(JQuery query)
Returns results for the Join Query, use default values for parameters |
JQueryResult |
executeQuery(JQuery query,
int startIdx,
int maxCount)
Returns results for the Joun Query, use default values for parameters |
JQueryResult |
executeQuery(JQuery query,
JQueryParameterSet params)
Returns results for the Join Query |
JQueryResult |
executeQuery(JQuery query,
JQueryParameterSet params,
int startIdx,
int maxCount)
Returns results for the Joun Query |
PersistableEntity |
get(ClassDescriptor cdes,
java.lang.String entityKey)
Returns the Entity for given Entity Key and ClassDescriptor |
MeIterator |
get(Query query)
Returns all entities for the query |
MeIterator |
getAll(ClassDescriptor cdes)
Gets the all attribute of the PersistenceManager object |
int |
getCount(Query query)
Returns the number of Results for the given Query |
PersistedObjectFactory |
getPersistedObjectFactory()
Returns an instance of PersistedObjectFactory |
void |
insert(PersistableEntity entity,
TreeOptionType treeOption)
Description of the Method |
void |
modify(PersistableEntity entity,
TreeOptionType treeOption)
Modifies an entity instance and all belonging instances, depending on TreeOptionType and Entity dependencies. |
void |
registerEntityFactory(EntityFactory factory)
Registers the EntityFactory to the PersistenceManger Instance |
void |
rollback()
Reverts the changes on persistent storage and releases the Lock on persistence Operations for other PersistenceManagers After call of rollback() the PersistenceManager is unusable. |
void |
update(PersistableEntity entity,
TreeOptionType treeOption)
Inserts or modifies an entity instance, and all belonging instances, depending on TreeOptionType and Entity dependencies. |
Method Detail |
public void insert(PersistableEntity entity, TreeOptionType treeOption) throws PersistenceException
entity
- Description of the ParametertreeOption
- Description of the Parameter
PersistenceException
- Description of the Exceptionpublic void update(PersistableEntity entity, TreeOptionType treeOption) throws PersistenceException
entity
- Description of the ParametertreeOption
- Description of the Parameter
PersistenceException
- Description of the Exceptionpublic void modify(PersistableEntity entity, TreeOptionType treeOption) throws PersistenceException
entity
- Description of the ParametertreeOption
- Description of the Parameter
PersistenceException
- Description of the Exceptionpublic PersistableEntity get(ClassDescriptor cdes, java.lang.String entityKey) throws PersistenceException
entityKey
- Description of the Parametercdes
- Description of the Parameter
PersistenceException
- Description of the Exceptionpublic JQueryResult executeQuery(JQuery query, JQueryParameterSet params) throws PersistenceException
query
- instance of com.sap.ip.me.api.persist.query.JQueryparams
- Query Parameters
PersistenceException
- I/O ErrorsJQuery
,
JQueryResult
public JQueryResult executeQuery(JQuery query, JQueryParameterSet params, int startIdx, int maxCount) throws PersistenceException
query
- instance of com.sap.ip.me.api.persist.query.JQueryparams
- Query ParametersstartIdx
- Offset for query executionmaxCount
- Maximum number of results
PersistenceException
- I/O ErrorsJQuery
,
JQueryResult
public JQueryResult executeQuery(JQuery query) throws PersistenceException
query
- instance of com.sap.ip.me.api.persist.query.JQuery
PersistenceException
- I/O ErrorsJQuery
,
JQueryResult
public JQueryResult executeQuery(JQuery query, int startIdx, int maxCount) throws PersistenceException
query
- instance of com.sap.ip.me.api.persist.query.JQuerystartIdx
- Offset for query executionmaxCount
- Maximum number of results
PersistenceException
- I/O ErrorsJQuery
,
JQueryResult
public MeIterator get(Query query) throws PersistenceException
query
- instance of com.sap.ip.api.persist.query.Query
PersistenceException
- I/O Errorspublic MeIterator getAll(ClassDescriptor cdes) throws PersistenceException
cdes
- ClassDescriptor instance
PersistenceException
- I/O Errorspublic int getCount(Query query) throws PersistenceException
query
- instance of com.sap.ip.api.persist.query.Query
PersistenceException
- I/O Errorspublic void delete(PersistableEntity entity, TreeOptionType treeOption) throws PersistenceException
entity
- instance of PersistableEntitytreeOption
- operation depth
PersistenceException
public void deleteAll(ClassDescriptor cdes, TreeOptionType treeOption) throws PersistenceException
cdes
- ClassDescriptor instancetreeOption
- operation depth
PersistenceException
- I/O Errorspublic void commit() throws PersistenceException
After call of commit() the PersistenceManager is unusable. You have to call PersistenceRuntime.getPersistenceManager() to receive a new instance.
PersistenceException
- if commit() is called from a non Transaction owner.public void rollback() throws PersistenceException
After call of rollback() the PersistenceManager is unusable. You have to call PersistenceRuntime.getPersistenceManager() to receive a new instance.
PersistenceException
- if rollback() is called from a non Transaction owner.public void registerEntityFactory(EntityFactory factory)
factory
- instance of EntityFactorypublic boolean entityFactoryIsRegistered()
public PersistedObjectFactory getPersistedObjectFactory()
public void beginTransaction(boolean doWait) throws PersistenceException
If beginTransaction() is not explicitly called, the first write operation on the PersistenceManager will start instance exclusive access. Read operations without beginTransaction() are prohibited and will throw PersistenceException
doWait
- Specify whether the Manager waits to get persistence access or Exception is thrown
PersistenceException
- if a concurrent access is detected and doWait is set to false.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |