Search in sources :

Example 11 with SQLBoolean

use of org.apache.derby.iapi.types.SQLBoolean in project derby by apache.

the class UpdateResultSet method evaluateCheckConstraints.

/**
 * Run check constraints against the current row. Raise an error if
 * a check constraint is violated, unless all the offending checks are
 * deferred, in which case a false value will be returned. A NULL value
 * will be interpreted as success (not violation).
 *
 * @exception StandardException thrown on error
 */
private boolean evaluateCheckConstraints() throws StandardException {
    boolean result = true;
    if (checkGM != null) {
        // Evaluate the check constraints. If all check constraint modes are
        // immediate, a check error will throw rather than return a false
        // value.
        SQLBoolean allOk = (SQLBoolean) checkGM.invoke(activation);
        result = allOk.isNull() || allOk.getBoolean();
    }
    return result;
}
Also used : SQLBoolean(org.apache.derby.iapi.types.SQLBoolean)

Aggregations

SQLBoolean (org.apache.derby.iapi.types.SQLBoolean)11 DataValueDescriptor (org.apache.derby.iapi.types.DataValueDescriptor)7 ExecRow (org.apache.derby.iapi.sql.execute.ExecRow)5 UserType (org.apache.derby.iapi.types.UserType)5 SQLVarchar (org.apache.derby.iapi.types.SQLVarchar)4 SQLChar (org.apache.derby.iapi.types.SQLChar)3 Timestamp (java.sql.Timestamp)2 UUID (org.apache.derby.catalog.UUID)2 ExecPreparedStatement (org.apache.derby.iapi.sql.execute.ExecPreparedStatement)2 SQLInteger (org.apache.derby.iapi.types.SQLInteger)2 AliasInfo (org.apache.derby.catalog.AliasInfo)1 IndexDescriptor (org.apache.derby.catalog.IndexDescriptor)1 ReferencedColumns (org.apache.derby.catalog.ReferencedColumns)1 ReferencedColumnsDescriptorImpl (org.apache.derby.catalog.types.ReferencedColumnsDescriptorImpl)1 FormatableBitSet (org.apache.derby.iapi.services.io.FormatableBitSet)1 Activation (org.apache.derby.iapi.sql.Activation)1 ResultSet (org.apache.derby.iapi.sql.ResultSet)1 StatementContext (org.apache.derby.iapi.sql.conn.StatementContext)1 AliasDescriptor (org.apache.derby.iapi.sql.dictionary.AliasDescriptor)1 ConglomerateDescriptor (org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor)1