|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.ws.jaxme.pm.impl.PMImpl org.apache.ws.jaxme.pm.impl.PMIdImpl org.apache.ws.jaxme.pm.xmldb.XmlDbPM
public class 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/interfaces 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()
Returns the database collection by invoking 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()
XmlDbPM
.
Method Detail |
---|
public void init(JMManager pManager) throws JAXBException
PM
Initializes the PM. Called from the
JAXBContextImpl
upon initialization.
init
in interface PM
init
in class PMIdImpl
pManager
- The manager being queried for configuration details.
JAXBException
public java.lang.String getCollection()
public void setCollection(java.lang.String pCollection)
public java.lang.Class getDriverClass()
public void setDriverClass(java.lang.Class pDriverClass)
public java.lang.String getPassword()
public void setPassword(java.lang.String pPassword)
public java.lang.String getUser()
public void setUser(java.lang.String pUser)
public java.lang.String getXPathQueryService()
public void setXPathQueryService(java.lang.String pXpathQueryService)
public java.lang.String getXPathQueryServiceVersion()
public void setXPathQueryServiceVersion(java.lang.String pXpathQueryServiceVersion)
protected org.xmldb.api.base.Collection getXmlDbCollection() throws org.xmldb.api.base.XMLDBException, java.lang.IllegalAccessException, java.lang.InstantiationException
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 JAXBException
PM
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.
JAXBException
public void insert(Element pElement) throws PMException
PM
Inserts the given document into the database.
PMException
public void update(Element pElement) throws PMException
PM
Updates the given document in the database.
PMException
public void delete(Element pElement) throws PMException
PM
Deletes the given document from the database.
PMException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |