|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.ws.jaxme.pm.impl.PMImpl
org.apache.ws.jaxme.pm.impl.PMIdImpl
org.apache.ws.jaxme.pm.xmldb.XmlDbPM
This is a persistence manager for the XML::DB interface. In other words, using this persistence manager you may read documents from a database via the XML::DB API or write them into the database using the same API.
This persistence manager is generic: The same manager works fine for any JAXB element.
| Nested Class Summary |
| Nested classes inherited from class org.apache.ws.jaxme.pm.impl.PMImpl |
PMImpl.ListObserver |
| Constructor Summary | |
XmlDbPM()
Creates a new instance of XmlDbPM. |
|
| Method Summary | |
void |
delete(Element pElement)
Deletes the given document from the database. |
java.lang.String |
getCollection()
Returns the collection name. |
java.lang.Class |
getDriverClass()
Returns the driver class. |
java.lang.String |
getPassword()
Returns the password. |
java.lang.String |
getUser()
Returns the users name. |
protected org.xmldb.api.base.Collection |
getXmlDbCollection()
Performs the database collection and invokes DatabaseManager.getCollection(String). |
java.lang.String |
getXPathQueryService()
Returns the name of the XPathQueryService. |
java.lang.String |
getXPathQueryServiceVersion()
Returns the version of the XPathQueryService. |
void |
init(JMManager pManager)
Initializes the PM. |
void |
insert(Element pElement)
Inserts the given document into the database. |
void |
select(Observer pObserver,
java.lang.String pQuery,
PMParams pPlaceHolderArgs)
Reads documents matching the given query. |
void |
setCollection(java.lang.String pCollection)
Sets the collection name. |
void |
setDriverClass(java.lang.Class pDriverClass)
Sets the driver class. |
void |
setPassword(java.lang.String pPassword)
Sets the password. |
void |
setUser(java.lang.String pUser)
Sets the users name. |
void |
setXPathQueryService(java.lang.String pXpathQueryService)
Sets the name of the XPathQueryService. |
void |
setXPathQueryServiceVersion(java.lang.String pXpathQueryServiceVersion)
Sets the version of the XPathQueryService. |
void |
update(Element pElement)
Updates the given document in the database. |
| Methods inherited from class org.apache.ws.jaxme.pm.impl.PMIdImpl |
getGetIdMethodName, getId, setGetIdMethodName |
| Methods inherited from class org.apache.ws.jaxme.pm.impl.PMImpl |
create, getManager, parseQuery, select, select, select |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public XmlDbPM()
Creates a new instance of XmlDbPM.
| Method Detail |
public void init(JMManager pManager)
throws JAXBException
PMInitializes the PM. Called from the
JAXBContextImpl upon initialization.
init in interface PMinit in class PMIdImplJAXBExceptionpublic java.lang.String getCollection()
Returns the collection name.
public void setCollection(java.lang.String pCollection)
Sets the collection name.
public java.lang.Class getDriverClass()
Returns the driver class.
public void setDriverClass(java.lang.Class pDriverClass)
Sets the driver class.
public java.lang.String getPassword()
Returns the password.
public void setPassword(java.lang.String pPassword)
Sets the password.
public java.lang.String getUser()
Returns the users name.
public void setUser(java.lang.String pUser)
Sets the users name.
public java.lang.String getXPathQueryService()
Returns the name of the XPathQueryService. Defaults to "XPathQueryService".
public void setXPathQueryService(java.lang.String pXpathQueryService)
Sets the name of the XPathQueryService. Defaults to "XPathQueryService".
public java.lang.String getXPathQueryServiceVersion()
Returns the version of the XPathQueryService. Defaults to "1.0".
public void setXPathQueryServiceVersion(java.lang.String pXpathQueryServiceVersion)
Sets the version of the XPathQueryService. Defaults to "1.0".
protected org.xmldb.api.base.Collection getXmlDbCollection()
throws org.xmldb.api.base.XMLDBException,
java.lang.IllegalAccessException,
java.lang.InstantiationException
Performs the database collection and invokes
DatabaseManager.getCollection(String).
org.xmldb.api.base.XMLDBException
java.lang.IllegalAccessException
java.lang.InstantiationException
public void select(Observer pObserver,
java.lang.String pQuery,
PMParams pPlaceHolderArgs)
throws PMException
PMReads 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
public void insert(Element pElement)
throws PMException
PMInserts the given document into the database.
PMException
public void update(Element pElement)
throws PMException
PMUpdates the given document in the database.
PMException
public void delete(Element pElement)
throws PMException
PMDeletes the given document from the database.
PMException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||