use of org.apache.derby.impl.sql.execute.DMLWriteResultSet in project derby by apache.
the class SQLBoolean method throwExceptionIfImmediateAndFalse.
public BooleanDataValue throwExceptionIfImmediateAndFalse(String sqlState, String tableName, String constraintName, Activation a, int savedUUIDIdx) throws StandardException {
if (!isNull() && (value == false)) {
final ExecPreparedStatement ps = a.getPreparedStatement();
final UUID constrId = (UUID) ps.getSavedObject(savedUUIDIdx);
final LanguageConnectionContext lcc = a.getLanguageConnectionContext();
final boolean isDeferred = lcc.isEffectivelyDeferred(lcc.getCurrentSQLSessionContext(a), constrId);
if (!isDeferred) {
throw StandardException.newException(sqlState, tableName, constraintName);
} else {
// Just return the false value and validate later,
// cf NoRowsResultSetImpl#evaluateCheckConstraints.
// and InsertResultSet#evaluateCheckConstraints
DMLWriteResultSet rs = (DMLWriteResultSet) a.getResultSet();
rs.rememberConstraint(constrId);
}
}
return this;
}
Aggregations