Class UpdateStatement
- java.lang.Object
-
- com.sun.jdo.spi.persistence.support.sqlstore.sql.generator.Statement
-
- com.sun.jdo.spi.persistence.support.sqlstore.sql.generator.UpdateStatement
-
-
Field Summary
Fields Modifier and Type Field Description int
minAffectedRows
static String
UPDATE_VERSION_COL_PROPERTY
Name of the USE_BATCH property.-
Fields inherited from class com.sun.jdo.spi.persistence.support.sqlstore.sql.generator.Statement
columns, inputDesc, messages, OP_BINOP_MASK, OP_FUNC_MASK, OP_INFIX_MASK, OP_IRREGULAR_MASK, OP_ORDERBY_MASK, OP_OTHER_MASK, OP_PARAM_MASK, OP_PAREN_MASK, OP_PCOUNT_MASK, OP_POSTFIX_MASK, OP_PREFIX_MASK, OP_WHERE_MASK, secondaryTableStatements, statementText, tableList, vendorType
-
-
Constructor Summary
Constructors Constructor Description UpdateStatement(DBVendorType vendorType, UpdateQueryPlan plan, boolean batch)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addColumn(org.netbeans.modules.dbschema.ColumnElement columnElement, Object value)
protected void
addConstraint(org.netbeans.modules.dbschema.ColumnElement columnElement, LocalFieldDesc lf, Object value)
Batch helper method.void
addForeignConstraints(int action, ForeignFieldDesc f, SQLStateManager sm)
void
addLocalConstraints(int action, ForeignFieldDesc f, SQLStateManager sm)
void
addVersionColumn(org.netbeans.modules.dbschema.ColumnElement versionColumn)
void
bindInputColumns(DBStatement s, UpdateObjectDescImpl updateDesc)
boolean
exceedsBatchThreshold(Transaction tran)
protected void
generateStatementText()
Generates the SQL text for the query described by this object.DBStatement
getDBStatement(Transaction tran, Connection conn)
Returns the cached db statement for the specified connection.String
getFormattedSQLText(UpdateObjectDescImpl updateDesc)
Gets formatted sql text corrsponding to this statement object.QueryPlan
getQueryPlan()
Get QueryPlan for this statementboolean
isConstraintAdded()
void
markConstraintAdded()
protected void
processConstraintValue(ConstraintValue node, StringBuilder result)
Redefines processConstraintValue in order to skip the creation of an InputValue in the case of batch.DBStatement
removeDBStatement(Transaction tran)
Removes the db statement for the specified connection from the cache and closes this statement.-
Methods inherited from class com.sun.jdo.spi.persistence.support.sqlstore.sql.generator.Statement
addColumnRef, addConstraint, addQueryTable, addSecondaryTableStatement, appendQuotedText, appendTableText, bindInputValues, clone, findQueryTable, formatSqlText, generateColumnText, generateInputValueForConstraintValueNode, getAction, getColumnRef, getColumnRefs, getFormattedSQLText, getOriginalPlan, getQueryTables, getSecondaryTableStatements, getText, getVendorType, getWhereText, infixOperator, operationFormat, postfixOperator, prefixOperator, processConstraintParamIndex, processConstraints, processIrregularOperation, processRootConstraint, setAction
-
-
-
-
Field Detail
-
minAffectedRows
public int minAffectedRows
-
UPDATE_VERSION_COL_PROPERTY
public static final String UPDATE_VERSION_COL_PROPERTY
Name of the USE_BATCH property.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
UpdateStatement
public UpdateStatement(DBVendorType vendorType, UpdateQueryPlan plan, boolean batch)
-
-
Method Detail
-
addColumn
public void addColumn(org.netbeans.modules.dbschema.ColumnElement columnElement, Object value)
-
addConstraint
protected void addConstraint(org.netbeans.modules.dbschema.ColumnElement columnElement, LocalFieldDesc lf, Object value)
Batch helper method. Adds the columnElement to the list of ColumnRefs for the where clause and then calls addConstraint.
-
isConstraintAdded
public boolean isConstraintAdded()
-
markConstraintAdded
public void markConstraintAdded()
-
getQueryPlan
public QueryPlan getQueryPlan()
Description copied from class:Statement
Get QueryPlan for this statement- Specified by:
getQueryPlan
in classStatement
- Returns:
- QueryPlan for this statement
-
generateStatementText
protected void generateStatementText()
Description copied from class:Statement
Generates the SQL text for the query described by this object.- Specified by:
generateStatementText
in classStatement
-
addLocalConstraints
public void addLocalConstraints(int action, ForeignFieldDesc f, SQLStateManager sm)
-
addForeignConstraints
public void addForeignConstraints(int action, ForeignFieldDesc f, SQLStateManager sm)
-
processConstraintValue
protected void processConstraintValue(ConstraintValue node, StringBuilder result)
Redefines processConstraintValue in order to skip the creation of an InputValue in the case of batch.- Overrides:
processConstraintValue
in classStatement
-
getDBStatement
public DBStatement getDBStatement(Transaction tran, Connection conn) throws SQLException
Returns the cached db statement for the specified connection. If there is not any statement for this connection in the cache, then a new statement is created.- Parameters:
tran
- the transactionconn
- the connection- Returns:
- the statement
- Throws:
SQLException
-
exceedsBatchThreshold
public boolean exceedsBatchThreshold(Transaction tran)
-
removeDBStatement
public DBStatement removeDBStatement(Transaction tran)
Removes the db statement for the specified connection from the cache and closes this statement.- Parameters:
tran
- the transaction
-
bindInputColumns
public void bindInputColumns(DBStatement s, UpdateObjectDescImpl updateDesc) throws SQLException
- Throws:
SQLException
-
getFormattedSQLText
public String getFormattedSQLText(UpdateObjectDescImpl updateDesc)
Gets formatted sql text corrsponding to this statement object. The text also contains values for input to the statement.- Parameters:
updateDesc
- the updateDesc.- Returns:
- formatted sql text corrsponding to this statement object.
-
addVersionColumn
public void addVersionColumn(org.netbeans.modules.dbschema.ColumnElement versionColumn)
-
-