All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class org.xmlmiddleware.xmldbms.DBMSDelete

java.lang.Object
   |
   +----org.xmlmiddleware.xmldbms.DBMSDelete

public class DBMSDelete
extends Object
Deletes data from the database.

DBMSDelete deletes data from the database according to particular XMLDBMSMap, FilterSet, and Actions objects. The XMLDBMSMap and FilterSet objects define the hierarchy of rows that DBMSDelete processes. The Actions object defines whether DBMSDelete deletes or ignores these rows. (It may be helpful to think of DBMSDelete as being almost identical to DBMSToDOM, except that DBMSDelete deletes rows instead of retrieving them.)

For example, the following code deletes sales order number 123 and related records.

    // Create the XMLDBMSMap object with a user-defined function.
    map = createMap("orders.map");
    
// Create an Actions object with a user-defined function. actions = createActions(map, "deleteorders.ftr");
// Create the FilterSet object with a user-defined function. filterSet = createFilterSet(map, "ordersbynumber.ftr");
// Create a new DBMSDelete object that uses the Xerces parser. dbmsDelete = new DBMSDelete(new ParserUtilsXerces());
// Create a data source and data handler for our database, then // bundle these into a TransferInfo object. ds = new JDBC1DataSource("sun.jdbc.odbc.JdbcOdbcDriver", "jdbc:odbc:xmldbms"); handler = new GenericHandler(ds, null, null); ti = new TransferInfo(map, null, handler);
// Build the parameters hashtable. params = new Hashtable(); params.put("$Number", "123");
// Call deleteDocument to delete the data. dbmsDelete.deleteDocument(ti, filterSet, params, actions);

Version:
2.0
Author:
Tobias Schilgen (mail@tobias-schilgen.de), Ronald Bourret, Jiri Zoth

Constructor Index

 o DBMSDelete()
Construct a new DBMSDelete object.

Method Index

 o deleteDocument(TransferInfo, FilterSet, Hashtable, Actions)
Delete a document based on the specified map, filter, and action.
 o deleteDocument(TransferInfo, FilterSet, Hashtable, int)
Delete a document based on the specified map, filter, and action.
 o getCommitMode()
Get the current commit mode.
 o setCommitMode(int)
Set the current commit mode.

Constructors

 o DBMSDelete
 public DBMSDelete()
Construct a new DBMSDelete object.

Methods

 o setCommitMode
 public void setCommitMode(int commitMode)
Set the current commit mode.

If the commit mode is not set, COMMIT_AFTERSTATEMENT is used by default.

Parameters:
commitMode - COMMIT_AFTERSTATEMENT, COMMIT_AFTERDOCUMENT, COMMIT_NONE, or COMMIT_NOTRANSACTIONS. These are defined in the DataHandler interface.
 o getCommitMode
 public int getCommitMode()
Get the current commit mode.

Returns:
The current commit mode.
 o deleteDocument
 public void deleteDocument(TransferInfo transferInfo,
                            FilterSet filterSet,
                            Hashtable params,
                            int action) throws SQLException, XMLMiddlewareException
Delete a document based on the specified map, filter, and action.

The filter set must contain at least one root filter.

Parameters:
transferInfo - Map and connection information.
filterSet - The filter set specifying the data to retrieve.
params - A Hashtable containing the names (keys) and values (elements) of any parameters used in the filters. Null if there are no parameters.
action - Action to be taken for each node of the document. This must be Action.DELETE or Action.SOFTDELETE.
Throws: SQLException
Thrown if a database error occurs deleting data
Throws: XMLMiddlewareException
Thrown if an XML-DBMS specific error occurs.
 o deleteDocument
 public void deleteDocument(TransferInfo transferInfo,
                            FilterSet filterSet,
                            Hashtable params,
                            Actions actions) throws SQLException, XMLMiddlewareException
Delete a document based on the specified map, filter, and action.

The filter set must contain at least one root filter.

Parameters:
transferInfo - Map and connection information.
filterSet - The filter set specifying the data to retrieve.
params - A Hashtable containing the names (keys) and values (elements) of any parameters used in the filters. Null if there are no parameters.
actions - An Actions object describing how to handle various elements of a document. The actual actions must be Action.NONE, Action.DELETE, or Action.SOFTDELETE.
Throws: XMLMiddlewareException
Thrown if an XML-DBMS specific error occurs.
Throws: SQLException
Thrown if a database error occurs deleting data

All Packages  Class Hierarchy  This Package  Previous  Next  Index