use of org.apache.derby.iapi.types.DataValueDescriptor in project derby by apache.
the class SYSCHECKSRowFactory method makeRow.
// ///////////////////////////////////////////////////////////////////////////
//
// METHODS
//
// ///////////////////////////////////////////////////////////////////////////
/**
* Make a SYSCHECKS row
*
* @param td CheckConstraintDescriptorImpl
*
* @return Row suitable for inserting into SYSCHECKS.
*
* @exception StandardException thrown on failure
*/
public ExecRow makeRow(TupleDescriptor td, TupleDescriptor parent) throws StandardException {
DataValueDescriptor col;
ExecIndexRow row;
ReferencedColumns rcd = null;
String checkDefinition = null;
String constraintID = null;
if (td != null) {
CheckConstraintDescriptor cd = (CheckConstraintDescriptor) td;
/*
** We only allocate a new UUID if the descriptor doesn't already have one.
** For descriptors replicated from a Source system, we already have an UUID.
*/
constraintID = cd.getUUID().toString();
checkDefinition = cd.getConstraintText();
rcd = cd.getReferencedColumnsDescriptor();
}
/* Build the row */
row = getExecutionFactory().getIndexableRow(SYSCHECKS_COLUMN_COUNT);
/* 1st column is CONSTRAINTID (UUID - char(36)) */
row.setColumn(SYSCHECKS_CONSTRAINTID, new SQLChar(constraintID));
/* 2nd column is CHECKDEFINITION */
row.setColumn(SYSCHECKS_CHECKDEFINITION, dvf.getLongvarcharDataValue(checkDefinition));
/* 3rd column is REFERENCEDCOLUMNS
* (user type org.apache.derby.catalog.ReferencedColumns)
*/
row.setColumn(SYSCHECKS_REFERENCEDCOLUMNS, new UserType(rcd));
return row;
}
use of org.apache.derby.iapi.types.DataValueDescriptor in project derby by apache.
the class SYSCOLPERMSRowFactory method setUUIDOfThePassedDescriptor.
// end of removePermissions
/**
* @see PermissionsCatalogRowFactory#setUUIDOfThePassedDescriptor
*/
public void setUUIDOfThePassedDescriptor(ExecRow row, PermissionsDescriptor perm) throws StandardException {
DataValueDescriptor existingPermDVD = row.getColumn(COLPERMSID_COL_NUM);
perm.setUUID(getUUIDFactory().recreateUUID(existingPermDVD.getString()));
}
use of org.apache.derby.iapi.types.DataValueDescriptor in project derby by apache.
the class SYSCONGLOMERATESRowFactory method getSchemaUUID.
/**
* Get the schema's UUID from the row.
*
* @param row The row from sysconglomerates
*
* @return UUID The schema's UUID
*
* @exception StandardException thrown on failure
*/
protected UUID getSchemaUUID(ExecRow row) throws StandardException {
DataValueDescriptor col;
String schemaUUIDString;
/* 1st column is SCHEMAID (UUID - char(36)) */
col = row.getColumn(SYSCONGLOMERATES_SCHEMAID);
schemaUUIDString = col.getString();
return getUUIDFactory().recreateUUID(schemaUUIDString);
}
use of org.apache.derby.iapi.types.DataValueDescriptor in project derby by apache.
the class SYSCONSTRAINTSRowFactory method getConstraintId.
/**
* Get the constraint ID of the row.
*
* @param row The row from sysconstraints
*
* @return UUID The constraint id
*
* @exception StandardException thrown on failure
*/
protected UUID getConstraintId(ExecRow row) throws StandardException {
DataValueDescriptor col;
String constraintUUIDString;
/* 1st column is CONSTRAINTID (UUID - char(36)) */
col = row.getColumn(SYSCONSTRAINTS_CONSTRAINTID);
constraintUUIDString = col.getString();
return getUUIDFactory().recreateUUID(constraintUUIDString);
}
use of org.apache.derby.iapi.types.DataValueDescriptor in project derby by apache.
the class SYSCONSTRAINTSRowFactory method getTableId.
/**
* Get the table ID of the row.
*
* @param row The row from sysconstraints
*
* @return UUID The table id
*
* @exception StandardException thrown on failure
*/
protected UUID getTableId(ExecRow row) throws StandardException {
DataValueDescriptor col;
String tableUUIDString;
/* 2nd column is TABLEID (UUID - char(36)) */
col = row.getColumn(SYSCONSTRAINTS_TABLEID);
tableUUIDString = col.getString();
return getUUIDFactory().recreateUUID(tableUUIDString);
}
Aggregations