|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.ispsoft.jaxme.JMManagerImpl de.ispsoft.jaxme.XmlDbManager
An implementation of a JMManager for a Tamino database.
Nested Class Summary |
Nested classes inherited from class de.ispsoft.jaxme.JMManagerImpl |
JMManagerImpl.MyObserver |
Field Summary | |
static java.lang.String |
COLLECTION_NODE_NAME
Name of the collection node. |
static java.lang.String |
CONFIGURATION_NODE_NAME
Name of our private configuration node (XmlDbManager in namespace JMManagerFactoryImpl.NAMESPACE_URI ) |
static java.lang.String |
DATABASE_PROPERTIES_NODE
Name of the DatabaseProperties node. |
static java.lang.String |
DATABASE_PROPERTY_NODE
Name of the DatabaseProperty node. |
static java.lang.String |
DRIVER_NODE_NAME
Name of the driver node. |
static java.lang.String |
ID_ATTRIBUTE_NODE
Name of the IdAttribute node. |
static java.lang.String |
ID_ELEMENT_NODE
Name of the IdElement node. |
static java.lang.String |
ID_NAMESPACE_NODE
Name of the IdNamespace node. |
static java.lang.String |
PASSWORD_NODE_NAME
Name of the Password node |
static java.lang.String |
USER_NODE_NAME
Name of the User node |
static java.lang.String |
XPATH_QUERY_SERVICE_NODE
Name of the XPathQueryService node |
static java.lang.String |
XPATH_QUERY_SERVICE_VERSION_NODE
Name of the XPathQueryServiceVersion node |
Fields inherited from class de.ispsoft.jaxme.JMManagerImpl |
ELEMENT_CLASS_NAME, HANDLER_CLASS_NAME, jmAnyElementClass, jmContentHandlerClass |
Fields inherited from interface de.ispsoft.jaxme.JMManager |
BIGINT, BIT, BLOB, BOOLEAN, CLOB, DECIMAL, DOUBLE, FLOAT, INTEGER, SMALLINT, TIMESTAMP, TINYINT, VARBINARY, VARCHAR |
Constructor Summary | |
XmlDbManager()
Creates a new instance of InoManager |
Method Summary | |
void |
delete(JMAnyElement pElement)
Deletes the given document from the database. |
java.lang.String |
getCollection()
|
java.lang.String |
getDriver()
|
java.lang.Class |
getDriverClass()
|
protected java.lang.String |
getId(JMAnyElement pElement)
Returns the elements ID. |
java.lang.String |
getIdAttribute()
|
java.lang.String |
getIdElement()
|
java.lang.String |
getIdNamespace()
|
java.lang.String |
getPassword()
|
java.lang.String |
getUser()
|
protected org.xmldb.api.base.Collection |
getXmlDbCollection()
|
java.lang.String |
getXPathQueryService()
|
java.lang.String |
getXPathQueryServiceVersion()
|
void |
insert(JMAnyElement pElement)
Inserts the given document into the database. |
void |
parseConfiguration(org.w3c.dom.Element pElement)
Parses a configuration element. |
void |
select(Observer pObserver,
java.lang.String pQuery,
java.lang.Object[] pPlaceHolderArgs,
int pStart,
int pMax)
Reads documents matching the given XPath query. |
void |
setCollection(java.lang.String pCollection)
|
void |
setDriver(java.lang.String pDriver)
|
void |
setDriverClass(java.lang.Class pClass)
|
void |
setIdAttribute(java.lang.String pIdAttribute)
|
void |
setIdElement(java.lang.String pIdElement)
|
void |
setIdNamespace(java.lang.String pIdNamespace)
|
void |
setPassword(java.lang.String pPassword)
|
void |
setUser(java.lang.String pUser)
|
void |
setXPathQueryService(java.lang.String pService)
|
void |
setXPathQueryServiceVersion(java.lang.String pVersion)
|
void |
update(JMAnyElement pElement)
Updates the given document in the database. |
Methods inherited from class de.ispsoft.jaxme.JMManagerImpl |
create, getJMAnyElementClass, getJMContentHandler, getLocalName, getNamespaceSupport, getNamespaceURI, init, select, select, select, select, select, select, select, toSAX, toWriter, toXML |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String CONFIGURATION_NODE_NAME
Name of our private configuration node (XmlDbManager in
namespace JMManagerFactoryImpl.NAMESPACE_URI
)
public static final java.lang.String DRIVER_NODE_NAME
Name of the driver node.
public static final java.lang.String COLLECTION_NODE_NAME
Name of the collection node.
public static final java.lang.String USER_NODE_NAME
Name of the User node
public static final java.lang.String PASSWORD_NODE_NAME
Name of the Password node
public static final java.lang.String XPATH_QUERY_SERVICE_NODE
Name of the XPathQueryService node
public static final java.lang.String XPATH_QUERY_SERVICE_VERSION_NODE
Name of the XPathQueryServiceVersion node
public static final java.lang.String ID_ATTRIBUTE_NODE
Name of the IdAttribute node.
public static final java.lang.String ID_ELEMENT_NODE
Name of the IdElement node.
public static final java.lang.String ID_NAMESPACE_NODE
Name of the IdNamespace node.
public static final java.lang.String DATABASE_PROPERTIES_NODE
Name of the DatabaseProperties node.
public static final java.lang.String DATABASE_PROPERTY_NODE
Name of the DatabaseProperty node.
Constructor Detail |
public XmlDbManager()
Method Detail |
public java.lang.String getDriver()
public void setDriver(java.lang.String pDriver)
public void setDriverClass(java.lang.Class pClass)
public java.lang.Class getDriverClass()
public void setCollection(java.lang.String pCollection)
public java.lang.String getCollection()
public void setUser(java.lang.String pUser)
public java.lang.String getUser()
public void setPassword(java.lang.String pPassword)
public java.lang.String getPassword()
public void setXPathQueryService(java.lang.String pService)
public java.lang.String getXPathQueryService()
public void setXPathQueryServiceVersion(java.lang.String pVersion)
public java.lang.String getXPathQueryServiceVersion()
public void setIdAttribute(java.lang.String pIdAttribute)
public java.lang.String getIdAttribute()
public void setIdElement(java.lang.String pIdElement)
public java.lang.String getIdElement()
public void setIdNamespace(java.lang.String pIdNamespace)
public java.lang.String getIdNamespace()
protected java.lang.String getId(JMAnyElement pElement)
Returns the elements ID. The default implementation uses the
attribute 'id' as an element ID. Another attribute can be used
by setting the child element IdAttribute
of the
XmlDbManager configuration.
If using an attribute as the ID is not appropriate for your
purposes, you need to create a subclass of XmlDbManager, which
overwrites the getId()
method.
public void parseConfiguration(org.w3c.dom.Element pElement)
Parses a configuration element. This method is called twice: Once for the default configuration and once for the specific configuration.
parseConfiguration
in class JMManagerImpl
protected org.xmldb.api.base.Collection getXmlDbCollection() throws org.xmldb.api.base.XMLDBException, java.lang.IllegalAccessException, java.lang.InstantiationException
org.xmldb.api.base.XMLDBException
java.lang.IllegalAccessException
java.lang.InstantiationException
public void delete(JMAnyElement pElement) throws org.xml.sax.SAXException
Deletes the given document from the database.
delete
in interface JMManager
delete
in class JMManagerImpl
org.xml.sax.SAXException
public void insert(JMAnyElement pElement) throws org.xml.sax.SAXException
Inserts the given document into the database.
insert
in interface JMManager
insert
in class JMManagerImpl
org.xml.sax.SAXException
public void update(JMAnyElement pElement) throws org.xml.sax.SAXException
Updates the given document in the database.
update
in interface JMManager
update
in class JMManagerImpl
org.xml.sax.SAXException
public void select(Observer pObserver, java.lang.String pQuery, java.lang.Object[] pPlaceHolderArgs, int pStart, int pMax) throws org.xml.sax.SAXException
Reads documents matching the given XPath 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 object array with two elements per placeholder: An Integer with a java.sql.Types type and the actual placeholder value. Example:
manager.select("Name = ? and Id = ?", new Object[]{JMManager.VARCHAR, "Someone", JMManager.INTEGER, 4}, 0, 0);
select
in interface JMManager
select
in class JMManagerImpl
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.pStart
- Ignore the given number of result documents at the
beginning. A value of zero will return all documents.pMax
- Return at most the given number of documents. A value
of zero will return all documents.
org.xml.sax.SAXException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |