org.apache.ws.jaxme.pm.xmldb
Class XmlDbPM
- PM
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.
XmlDbPM() - Creates a new instance of
XmlDbPM .
|
XmlDbPM
public XmlDbPM()
Creates a new instance of XmlDbPM
.
getCollection
public String getCollection()
Returns the collection name.
getDriverClass
public Class getDriverClass()
Returns the driver class.
getPassword
public String getPassword()
Returns the password.
getUser
public String getUser()
Returns the users name.
getXPathQueryService
public String getXPathQueryService()
Returns the name of the XPathQueryService. Defaults to
"XPathQueryService".
getXPathQueryServiceVersion
public String getXPathQueryServiceVersion()
Returns the version of the XPathQueryService. Defaults to
"1.0".
getXmlDbCollection
protected Collection getXmlDbCollection()
throws XMLDBException,
IllegalAccessException,
InstantiationException
Returns the database collection by invoking
DatabaseManager.getCollection(String)
.
select
public void select(Observer pObserver,
String pQuery,
PMParams pPlaceHolderArgs)
throws JAXBException
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));
- select in interface PM
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.
setCollection
public void setCollection(String pCollection)
Sets the collection name.
setDriverClass
public void setDriverClass(Class pDriverClass)
Sets the driver class.
setPassword
public void setPassword(String pPassword)
Sets the password.
setUser
public void setUser(String pUser)
Sets the users name.
setXPathQueryService
public void setXPathQueryService(String pXpathQueryService)
Sets the name of the XPathQueryService. Defaults to
"XPathQueryService".
setXPathQueryServiceVersion
public void setXPathQueryServiceVersion(String pXpathQueryServiceVersion)
Sets the version of the XPathQueryService. Defaults to
"1.0".