|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PM
The persistence manager
(or PM
for short) is responsible for reading objects from the
database or storing them into the database.
Method Summary | |
---|---|
java.lang.Object |
create()
Creates a new, empty element. |
void |
delete(Element element)
Deletes the given document from the database. |
JMManager |
getManager()
Returns the manager being queried for configuration details. |
void |
init(JMManager pManager)
Initializes the PM. |
void |
insert(Element element)
Inserts the given document into the database. |
void |
select(Observer pObserver,
java.lang.String pQuery)
Reads documents matching the given query. |
void |
select(Observer pObserver,
java.lang.String pQuery,
PMParams pPlaceHolderArgs)
Reads documents matching the given query. |
java.util.Iterator |
select(java.lang.String pQuery)
Returns an iterator to all documents matching the given query. |
java.util.Iterator |
select(java.lang.String pQuery,
PMParams pPlaceHolderArgs)
Returns an iterator to all documents matching the given query. |
void |
update(Element element)
Updates the given document in the database. |
Method Detail |
---|
void init(JMManager pManager) throws JAXBException
Initializes the PM. Called from the
JAXBContextImpl
upon initialization.
pManager
- The manager being queried for configuration details.
JAXBException
JMManager getManager()
Returns the manager being queried for configuration details.
void select(Observer pObserver, java.lang.String pQuery) throws PMException
Reads documents matching the given query. For any document matching, the Observer's notify method is executed with the matching document as an argument.
pObserver
- This Observer is notified for any matching document.
The document is added as an argument.pQuery
- The query to perform.
PMException
void select(Observer pObserver, java.lang.String pQuery, PMParams pPlaceHolderArgs) throws PMException
Reads documents matching the given query. For any document matching, the Observer's notify method is executed with the matching document as an argument.
The query may contain placeholders. If it does, you have
to supply an instance of PMParams
with the placeholder
values. Example:
manager.select("Name = ? and Id = ?", new PMParams().addString("Someone").addInt(4));
pObserver
- This Observer is notified for any matching document.
The document is added as an argument.pQuery
- The query to perform. May contain placeholders.pPlaceHolderArgs
- An array of objects or null, if the
query doesn't contain any placeholders.
PMException
java.util.Iterator select(java.lang.String pQuery) throws PMException
Returns an iterator to all documents matching the given query.
pQuery
- The query to perform.
PMException
java.util.Iterator select(java.lang.String pQuery, PMParams pPlaceHolderArgs) throws PMException
Returns an iterator to all documents matching the given query.
The query may contain placeholders. If it does, you have
to supply an instance of PMParams
with the placeholder
values. Example:
manager.select("Name = ? and Id = ?", new PMParams().addString("Someone").addInt(4));
pQuery
- The query to perform. May contain placeholders.pPlaceHolderArgs
- An array of objects or null, if the
query doesn't contain any placeholders.
PMException
void insert(Element element) throws PMException
Inserts the given document into the database.
PMException
void update(Element element) throws PMException
Updates the given document in the database.
PMException
void delete(Element element) throws PMException
Deletes the given document from the database.
PMException
java.lang.Object create() throws JAXBException
Creates a new, empty element.
JAXBException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |