de.ispsoft.jaxme
Interface JMManager

All Known Implementing Classes:
JMManagerImpl

public interface JMManager

A Manager is responsible for reading, inserting, updating and deleting documents.

Author:
Jochen Wiedmann

Field Summary
static java.lang.Integer BIGINT
          A placeholder type matching java.sql.Types.BIGINT.
static java.lang.Integer BIT
          A placeholder type matching java.sql.Types.BIT.
static java.lang.Integer BLOB
          Another placeholder type matching java.sql.Types.BLOB.
static java.lang.Integer BOOLEAN
          Another placeholder type matching java.sql.Types.BIT.
static java.lang.Integer CLOB
          A placeholder type matching java.sql.Types.CLOB.
static java.lang.Integer DECIMAL
          A placeholder type matching java.sql.Types.DECIMAL.
static java.lang.Integer DOUBLE
          A placeholder type matching java.sql.Types.DOUBLE.
static java.lang.Integer FLOAT
          A placeholder type matching java.sql.Types.FLOAT.
static java.lang.Integer INTEGER
          A placeholder type matching java.sql.Types.INTEGER.
static java.lang.Integer SMALLINT
          A placeholder type matching java.sql.Types.SHORTINT.
static java.lang.Integer TIMESTAMP
          A placeholder type matching java.sql.Types.TIMESTAMP.
static java.lang.Integer TINYINT
          A placeholder type matching java.sql.Types.TINYINT.
static java.lang.Integer VARBINARY
          A placeholder type matching java.sql.Types.VARBINARY.
static java.lang.Integer VARCHAR
          A placeholder type matching java.sql.Types.VARCHAR.
 
Method Summary
 JMAnyElement create()
          Creates a new, empty element.
 void delete(JMAnyElement element)
          Deletes the given document from the database.
 JMContentHandler getJMContentHandler()
          Returns a JMContentHandler that can be used for parsing documents.
 java.lang.String getLocalName()
          Returns the local name of the document type handled by this manager.
 java.lang.String getNamespaceURI()
          Returns the namespace URI of the document type handled by this manager.
 void init(JMManagerFactory pFactory, java.lang.String pNamespaceURI, java.lang.String pLocalName)
          Initializes the manager.
 void insert(JMAnyElement 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, int pStart, int pMax)
          Reads documents matching the given query.
 void select(Observer pObserver, java.lang.String pQuery, java.lang.Object[] pPlaceHolderArgs)
          Reads documents matching the given query.
 void select(Observer pObserver, java.lang.String pQuery, java.lang.Object[] pPlaceHolderArgs, int pStart, int pMax)
          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, int pStart, int pMax)
          Returns an iterator to all documents matching the given query.
 java.util.Iterator select(java.lang.String pQuery, java.lang.Object[] pPlaceHolderArgs)
          Returns an iterator to all documents matching the given query.
 java.util.Iterator select(java.lang.String pQuery, java.lang.Object[] pPlaceHolderArgs, int pStart, int pMax)
          Returns an iterator to all documents matching the given query.
 void update(JMAnyElement element)
          Updates the given document in the database.
 

Field Detail

VARBINARY

public static final java.lang.Integer VARBINARY

A placeholder type matching java.sql.Types.VARBINARY.


VARCHAR

public static final java.lang.Integer VARCHAR

A placeholder type matching java.sql.Types.VARCHAR.


INTEGER

public static final java.lang.Integer INTEGER

A placeholder type matching java.sql.Types.INTEGER.


BIGINT

public static final java.lang.Integer BIGINT

A placeholder type matching java.sql.Types.BIGINT.


TINYINT

public static final java.lang.Integer TINYINT

A placeholder type matching java.sql.Types.TINYINT.


SMALLINT

public static final java.lang.Integer SMALLINT

A placeholder type matching java.sql.Types.SHORTINT.


TIMESTAMP

public static final java.lang.Integer TIMESTAMP

A placeholder type matching java.sql.Types.TIMESTAMP.


DOUBLE

public static final java.lang.Integer DOUBLE

A placeholder type matching java.sql.Types.DOUBLE.


FLOAT

public static final java.lang.Integer FLOAT

A placeholder type matching java.sql.Types.FLOAT.


BIT

public static final java.lang.Integer BIT

A placeholder type matching java.sql.Types.BIT.


BOOLEAN

public static final java.lang.Integer BOOLEAN

Another placeholder type matching java.sql.Types.BIT.


DECIMAL

public static final java.lang.Integer DECIMAL

A placeholder type matching java.sql.Types.DECIMAL.


BLOB

public static final java.lang.Integer BLOB

Another placeholder type matching java.sql.Types.BLOB.


CLOB

public static final java.lang.Integer CLOB

A placeholder type matching java.sql.Types.CLOB.

Method Detail

init

public void init(JMManagerFactory pFactory,
                 java.lang.String pNamespaceURI,
                 java.lang.String pLocalName)
          throws org.xml.sax.SAXException

Initializes the manager.

Throws:
org.xml.sax.SAXException

getNamespaceURI

public java.lang.String getNamespaceURI()

Returns the namespace URI of the document type handled by this manager.


getLocalName

public java.lang.String getLocalName()

Returns the local name of the document type handled by this manager.


select

public void select(Observer pObserver,
                   java.lang.String pQuery)
            throws org.xml.sax.SAXException

Reads documents matching the given query. For any document matching, the Observer's notify method is executed with the matching document as an argument.

Parameters:
pObserver - This Observer is notified for any matching document. The document is added as an argument.
pQuery - The query to perform.
Throws:
org.xml.sax.SAXException

select

public void select(Observer pObserver,
                   java.lang.String pQuery,
                   java.lang.Object[] pPlaceHolderArgs)
            throws org.xml.sax.SAXException

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 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});
 

Parameters:
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.
Throws:
org.xml.sax.SAXException

select

public void select(Observer pObserver,
                   java.lang.String pQuery,
                   int pStart,
                   int pMax)
            throws org.xml.sax.SAXException

Reads documents matching the given query. For any document matching, the Observer's notify method is executed with the matching document as an argument.

Parameters:
pObserver - This Observer is notified for any matching document. The document is added as an argument.
pQuery - The query to perform.
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.
Throws:
org.xml.sax.SAXException

select

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 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);
 

Parameters:
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.
Throws:
org.xml.sax.SAXException

select

public java.util.Iterator select(java.lang.String pQuery,
                                 int pStart,
                                 int pMax)
                          throws org.xml.sax.SAXException

Returns an iterator to all documents matching the given query.

Parameters:
pQuery - The query to perform.
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.
Throws:
org.xml.sax.SAXException

select

public java.util.Iterator select(java.lang.String pQuery,
                                 java.lang.Object[] pPlaceHolderArgs,
                                 int pStart,
                                 int pMax)
                          throws org.xml.sax.SAXException

Returns an iterator to all documents matching the given query. 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);
 

Parameters:
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.
Throws:
org.xml.sax.SAXException

select

public java.util.Iterator select(java.lang.String pQuery)
                          throws org.xml.sax.SAXException

Returns an iterator to all documents matching the given query.

Parameters:
pQuery - The query to perform.
Throws:
org.xml.sax.SAXException

select

public java.util.Iterator select(java.lang.String pQuery,
                                 java.lang.Object[] pPlaceHolderArgs)
                          throws org.xml.sax.SAXException

Returns an iterator to all documents matching the given query. 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);
 

Parameters:
pQuery - The query to perform. May contain placeholders.
pPlaceHolderArgs - An array of objects or null, if the query doesn't contain any placeholders.
Throws:
org.xml.sax.SAXException

insert

public void insert(JMAnyElement element)
            throws org.xml.sax.SAXException

Inserts the given document into the database.

Throws:
org.xml.sax.SAXException

update

public void update(JMAnyElement element)
            throws org.xml.sax.SAXException

Updates the given document in the database.

Throws:
org.xml.sax.SAXException

delete

public void delete(JMAnyElement element)
            throws org.xml.sax.SAXException

Deletes the given document from the database.

Throws:
org.xml.sax.SAXException

create

public JMAnyElement create()
                    throws org.xml.sax.SAXException

Creates a new, empty element.

Throws:
org.xml.sax.SAXException

getJMContentHandler

public JMContentHandler getJMContentHandler()
                                     throws org.xml.sax.SAXException

Returns a JMContentHandler that can be used for parsing documents.

Throws:
org.xml.sax.SAXException