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, cursorName, escapeProcessing, fetchSize, id, isAutoCommit, isParsed, isReadOnly, login, maxRows, requestType, sqlQuery, sqlSkeleton, timeoutInSeconds, transactionId, transactionIsolation
 
Constructor Summary
AbstractWriteRequest(CJDBCInputStream in, int requestType)
          Creates a new AbstractWriteRequest object
AbstractWriteRequest(java.lang.String sqlQuery, boolean escapeProcessing, int timeout, java.lang.String lineSeparator, int requestType)
          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.
 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, getCursorName, getEscapeProcessing, getFetchSize, getId, getLineSeparator, getLogin, getMaxRows, getSQL, getSQLShortForm, getSqlSkeleton, getTimeout, getTransactionId, getTransactionIsolation, isAlter, isAutoCommit, isCreate, isDDL, isDelete, isDML, isDriverProcessed, isDrop, isInsert, isParsed, isReadOnly, isSelect, isUpdate, needsMacroProcessing, parse, receiveResultSetParams, returnsResultSet, sendResultSetParams, sendToStream, setCacheAbility, setCursorName, setDriverProcessed, setFetchSize, setId, setIsAutoCommit, setIsReadOnly, setLogin, setMaxRows, setSQL, setSqlSkeleton, setTimeout, setTransactionId, setTransactionIsolation, trimCarriageReturnAndTabs
 
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,
                            int requestType)
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
requestType - the request type as defined in RequestType class
See Also:
RequestType

AbstractWriteRequest

public AbstractWriteRequest(CJDBCInputStream in,
                            int requestType)
                     throws java.io.IOException
Creates a new AbstractWriteRequest object

Parameters:
in - the input stream to read the request from
requestType - the request type as defined in RequestType class
Throws:
java.io.IOException - if an error occurs
See Also:
RequestType, AbstractRequest.AbstractRequest(CJDBCInputStream, int)
Method Detail

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.