|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.objectweb.cjdbc.common.sql.AbstractRequest
org.objectweb.cjdbc.common.sql.AbstractWriteRequest
org.objectweb.cjdbc.common.sql.AlterRequest
This class defines a AlterRequest
| Field Summary | |
private DatabaseColumn |
column
The column altered |
private boolean |
isAdd
|
private boolean |
isDrop
|
private DatabaseTable |
table
The table to alter. |
| Fields inherited from class org.objectweb.cjdbc.common.sql.AbstractWriteRequest |
blocking, columns, pkValue, tableName |
| Fields inherited from class org.objectweb.cjdbc.common.sql.AbstractRequest |
cacheable, escapeProcessing, id, isAutoCommit, isParsed, isReadOnly, login, maxRows, sqlQuery, sqlSkeleton, timeout, transactionId |
| Constructor Summary | |
AlterRequest(java.lang.String sqlQuery,
boolean escapeProcessing,
int timeout,
java.lang.String lineSeparator)
Creates a new AlterRequest instance. |
|
AlterRequest(java.lang.String sqlQuery,
boolean escapeProcessing,
int timeout,
java.lang.String lineSeparator,
DatabaseSchema schema,
int granularity,
boolean isCaseSensitive)
Creates a new AlterRequest instance. |
|
| Method Summary | |
void |
cloneParsing(AbstractRequest request)
Clones the parsing of a request. |
DatabaseColumn |
getColumn()
Returns the column value. |
DatabaseTable |
getDatabaseTable()
Returns the table value. |
boolean |
isAdd()
Returns the isAdd value. |
boolean |
isAlter()
Returns true if this request in a ALTER
statement. |
boolean |
isCreate()
Returns true if this request in a CREATE
statement. |
boolean |
isDelete()
Returns true if this request in a DELETE
statement. |
boolean |
isDrop()
Returns true if this request in a DROP
statement. |
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). |
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). |
void |
parse(DatabaseSchema schema,
int granularity,
boolean isCaseSensitive)
Parses the SQL request and extract the selected columns and tables given the DatabaseSchema of the database targeted by this request.
|
| Methods inherited from class org.objectweb.cjdbc.common.sql.AbstractWriteRequest |
cloneTableNameAndColumns, getColumns, getPk, getTableName, mightBlock, setBlocking |
| Methods inherited from class org.objectweb.cjdbc.common.sql.AbstractRequest |
debug, equals, getCacheAbility, getEscapeProcessing, getFetchSize, getId, getLineSeparator, getLogin, getMaxRows, getSQL, getSQLShortForm, getSqlSkeleton, getTimeout, getTransactionId, isAutoCommit, isDriverProcessed, isParsed, isReadOnly, 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 |
private transient DatabaseTable table
private transient DatabaseColumn column
private transient boolean isDrop
private transient boolean isAdd
| Constructor Detail |
public AlterRequest(java.lang.String sqlQuery,
boolean escapeProcessing,
int timeout,
java.lang.String lineSeparator)
AlterRequest instance. The caller must give
an SQL request, without any leading or trailing spaces and beginning with
'alter table '
The request is not parsed but it can be done later by a call to
parse(DatabaseSchema, int, boolean).
sqlQuery - the SQL requestescapeProcessing - should the driver to escape processing before
sending to the database ?timeout - an int valuelineSeparator - the line separator used in the queryparse(org.objectweb.cjdbc.common.sql.schema.DatabaseSchema, int, boolean)
public AlterRequest(java.lang.String sqlQuery,
boolean escapeProcessing,
int timeout,
java.lang.String lineSeparator,
DatabaseSchema schema,
int granularity,
boolean isCaseSensitive)
throws java.sql.SQLException
AlterRequest instance. The caller must give an
SQL request, without any leading or trailing spaces and beginning with
'alter table '
If the syntax is incorrect an exception is thrown.
sqlQuery - the SQL requestescapeProcessing - should the driver to escape processing before
sending to the database?timeout - an int valuelineSeparator - the line separator used in the queryschema - a DatabaseSchema valuegranularity - parsing granularity as defined in
ParsingGranularitiesisCaseSensitive - true if parsing is case sensitive
java.sql.SQLException - if an error occurs| Method Detail |
public boolean isReadRequest()
AbstractRequesttrue if this request is a read request (
SELECT requests for example perform a read).
isReadRequest in class AbstractWriteRequestfalseAbstractRequest.isReadRequest()public boolean isWriteRequest()
AbstractRequesttrue if this request is a write request (
INSERT or UPDATE for example perform writes).
isWriteRequest in class AbstractWriteRequesttrueAbstractRequest.isWriteRequest()public boolean isUnknownRequest()
AbstractRequesttrue if the resulting operation on this request is
unknown (some non-standard command or stored procedure for example).
isUnknownRequest in class AbstractWriteRequestfalseAbstractRequest.isUnknownRequest()
public void parse(DatabaseSchema schema,
int granularity,
boolean isCaseSensitive)
throws java.sql.SQLException
AbstractRequestDatabaseSchema of the database targeted by this request.
An exception is thrown when the parsing fails. Warning, this method does not check the validity of the request. In particular, invalid request could be parsed without throwing an exception. However, valid SQL request should never throw an exception.
parse in class AbstractRequestschema - a DatabaseSchema valuegranularity - parsing granularity as defined in
ParsingGranularitiesisCaseSensitive - true if parsing must be case sensitive
java.sql.SQLException - if the parsing failsAbstractRequest.parse(org.objectweb.cjdbc.common.sql.schema.DatabaseSchema,
int, boolean)public void cloneParsing(AbstractRequest request)
AbstractRequest
cloneParsing in class AbstractRequestrequest - the parsed request to cloneAbstractRequest.cloneParsing(org.objectweb.cjdbc.common.sql.AbstractRequest)public boolean isAlter()
AbstractWriteRequesttrue if this request in a ALTER
statement.
isAlter in class AbstractWriteRequestboolean valueAbstractWriteRequest.isAlter()public boolean isCreate()
AbstractWriteRequesttrue if this request in a CREATE
statement.
isCreate in class AbstractWriteRequestboolean valueAbstractWriteRequest.isCreate()public boolean isDelete()
AbstractWriteRequesttrue if this request in a DELETE
statement.
isDelete in class AbstractWriteRequestboolean valueAbstractWriteRequest.isDelete()public boolean isDrop()
AbstractWriteRequesttrue if this request in a DROP
statement.
isDrop in class AbstractWriteRequestboolean valueAbstractWriteRequest.isDrop()public boolean isInsert()
AbstractWriteRequesttrue if this request in an INSERT
statement.
isInsert in class AbstractWriteRequestboolean valueAbstractWriteRequest.isInsert()public boolean isUpdate()
AbstractWriteRequesttrue if this request in an UPDATE
statement.
isUpdate in class AbstractWriteRequestboolean valueAbstractWriteRequest.isUpdate()public DatabaseTable getDatabaseTable()
public DatabaseColumn getColumn()
public boolean isAdd()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||