org.objectweb.cjdbc.common.sql
Class AbstractWriteRequest

java.lang.Object
  extended byorg.objectweb.cjdbc.common.sql.AbstractRequest
      extended byorg.objectweb.cjdbc.common.sql.AbstractWriteRequest
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
AlterRequest, CreateRequest, DeleteRequest, DropRequest, InsertRequest, UpdateRequest

public abstract class AbstractWriteRequest
extends AbstractRequest

An AbstractWriteRequest defines the skeleton of read requests that are sent from the driver to the controller.

Version:
1.0
Author:
Emmanuel Cecchet
See Also:
Serialized Form

Field Summary
protected  boolean blocking
          true if this request might block.
protected  java.util.ArrayList columns
          ArrayList of TableColumn involved in this write query.
protected  java.lang.String pkValue
          Primary key value
protected  java.lang.String tableName
          Name of the table involved in this write query.
 
Fields inherited from class org.objectweb.cjdbc.common.sql.AbstractRequest
cacheable, escapeProcessing, id, isAutoCommit, isParsed, isReadOnly, login, maxRows, sqlQuery, sqlSkeleton, timeout, transactionId
 
Constructor Summary
AbstractWriteRequest(java.lang.String sqlQuery, boolean escapeProcessing, int timeout, java.lang.String lineSeparator)
          Creates a new AbstractWriteRequest object
 
Method Summary
protected  void cloneTableNameAndColumns(AbstractWriteRequest abstractWriteRequest)
          Clones table name and columns from an already parsed request.
 java.util.ArrayList getColumns()
          Returns an ArrayList of TableColumn objects representing the columns affected by this statement.
 java.lang.String getPk()
           
 java.lang.String getTableName()
          Returns the name of the table affected by this statement.
abstract  boolean isAlter()
          Returns true if this request in a ALTER statement.
abstract  boolean isCreate()
          Returns true if this request in a CREATE statement.
abstract  boolean isDelete()
          Returns true if this request in a DELETE statement.
abstract  boolean isDrop()
          Returns true if this request in a DROP statement.
abstract  boolean isInsert()
          Returns true if this request in an INSERT statement.
 boolean isReadRequest()
          Returns true if this request is a read request ( SELECT requests for example perform a read).
 boolean isUnknownRequest()
          Returns true if the resulting operation on this request is unknown (some non-standard command or stored procedure for example).
abstract  boolean isUpdate()
          Returns true if this request in an UPDATE statement.
 boolean isWriteRequest()
          Returns true if this request is a write request ( INSERT or UPDATE for example perform writes).
 boolean mightBlock()
          Tests if this request might block.
 void setBlocking(boolean blocking)
          Sets if this request might block.
 
Methods inherited from class org.objectweb.cjdbc.common.sql.AbstractRequest
cloneParsing, debug, equals, getCacheAbility, getEscapeProcessing, getFetchSize, getId, getLineSeparator, getLogin, getMaxRows, getSQL, getSQLShortForm, getSqlSkeleton, getTimeout, getTransactionId, isAutoCommit, isDriverProcessed, isParsed, isReadOnly, parse, setCacheAbility, setDriverProcessed, setFetchSize, setId, setIsAutoCommit, setIsReadOnly, setLineSeparator, setLogin, setMaxRows, setSQL, setSqlSkeleton, setTimeout, setTransactionId, trimCarriageReturn
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tableName

protected transient java.lang.String tableName
Name of the table involved in this write query.


columns

protected transient java.util.ArrayList columns
ArrayList of TableColumn involved in this write query.


blocking

protected transient boolean blocking
true if this request might block.


pkValue

protected transient java.lang.String pkValue
Primary key value

Constructor Detail

AbstractWriteRequest

public AbstractWriteRequest(java.lang.String sqlQuery,
                            boolean escapeProcessing,
                            int timeout,
                            java.lang.String lineSeparator)
Creates a new AbstractWriteRequest object

Parameters:
sqlQuery - the SQL query
escapeProcessing - should the driver to escape processing before sending to the database ?
timeout - an int value
lineSeparator - the line separator used in the query
Method Detail

isReadRequest

public boolean isReadRequest()
Description copied from class: AbstractRequest
Returns true if this request is a read request ( SELECT requests for example perform a read).

Specified by:
isReadRequest in class AbstractRequest
Returns:
false
See Also:
AbstractRequest.isReadRequest()

isWriteRequest

public boolean isWriteRequest()
Description copied from class: AbstractRequest
Returns true if this request is a write request ( INSERT or UPDATE for example perform writes).

Specified by:
isWriteRequest in class AbstractRequest
Returns:
true
See Also:
AbstractRequest.isWriteRequest()

isUnknownRequest

public boolean isUnknownRequest()
Description copied from class: AbstractRequest
Returns true if the resulting operation on this request is unknown (some non-standard command or stored procedure for example).

Specified by:
isUnknownRequest in class AbstractRequest
Returns:
false
See Also:
AbstractRequest.isUnknownRequest()

isInsert

public abstract boolean isInsert()
Returns true if this request in an INSERT statement.

Returns:
a boolean value

isUpdate

public abstract boolean isUpdate()
Returns true if this request in an UPDATE statement.

Returns:
a boolean value

isDelete

public abstract boolean isDelete()
Returns true if this request in a DELETE statement.

Returns:
a boolean value

isAlter

public abstract boolean isAlter()
Returns true if this request in a ALTER statement.

Returns:
a boolean value

isCreate

public abstract boolean isCreate()
Returns true if this request in a CREATE statement.

Returns:
a boolean value

isDrop

public abstract boolean isDrop()
Returns true if this request in a DROP statement.

Returns:
a boolean value

getTableName

public java.lang.String getTableName()
Returns the name of the table affected by this statement.

Returns:
a String value

getColumns

public java.util.ArrayList getColumns()
Returns an ArrayList of TableColumn objects representing the columns affected by this statement.

Returns:
an ArrayList value

cloneTableNameAndColumns

protected void cloneTableNameAndColumns(AbstractWriteRequest abstractWriteRequest)
Clones table name and columns from an already parsed request.

Parameters:
abstractWriteRequest - the already parsed request

mightBlock

public boolean mightBlock()
Tests if this request might block.

Returns:
true if this request might block

setBlocking

public void setBlocking(boolean blocking)
Sets if this request might block.

Parameters:
blocking - a boolean value

getPk

public java.lang.String getPk()
Returns:
Returns the pk.


Copyright © 2002, 2005 - ObjectWeb Consortium - All Rights Reserved.