Search in sources :

Example 61 with DataValueDescriptor

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;
}
Also used : ReferencedColumns(org.apache.derby.catalog.ReferencedColumns) SQLChar(org.apache.derby.iapi.types.SQLChar) DataValueDescriptor(org.apache.derby.iapi.types.DataValueDescriptor) CheckConstraintDescriptor(org.apache.derby.iapi.sql.dictionary.CheckConstraintDescriptor) SubCheckConstraintDescriptor(org.apache.derby.iapi.sql.dictionary.SubCheckConstraintDescriptor) ExecIndexRow(org.apache.derby.iapi.sql.execute.ExecIndexRow) UserType(org.apache.derby.iapi.types.UserType)

Example 62 with DataValueDescriptor

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()));
}
Also used : DataValueDescriptor(org.apache.derby.iapi.types.DataValueDescriptor)

Example 63 with DataValueDescriptor

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);
}
Also used : DataValueDescriptor(org.apache.derby.iapi.types.DataValueDescriptor)

Example 64 with DataValueDescriptor

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);
}
Also used : DataValueDescriptor(org.apache.derby.iapi.types.DataValueDescriptor)

Example 65 with DataValueDescriptor

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);
}
Also used : DataValueDescriptor(org.apache.derby.iapi.types.DataValueDescriptor)

Aggregations

DataValueDescriptor (org.apache.derby.iapi.types.DataValueDescriptor)328 ExecIndexRow (org.apache.derby.iapi.sql.execute.ExecIndexRow)72 ExecRow (org.apache.derby.iapi.sql.execute.ExecRow)62 RowLocation (org.apache.derby.iapi.types.RowLocation)54 SQLLongint (org.apache.derby.iapi.types.SQLLongint)51 StandardException (org.apache.derby.shared.common.error.StandardException)43 SQLChar (org.apache.derby.iapi.types.SQLChar)42 FormatableBitSet (org.apache.derby.iapi.services.io.FormatableBitSet)36 SQLVarchar (org.apache.derby.iapi.types.SQLVarchar)36 ScanController (org.apache.derby.iapi.store.access.ScanController)35 ConglomerateController (org.apache.derby.iapi.store.access.ConglomerateController)32 UUID (org.apache.derby.catalog.UUID)31 TupleDescriptor (org.apache.derby.iapi.sql.dictionary.TupleDescriptor)24 RawTransaction (org.apache.derby.iapi.store.raw.xact.RawTransaction)16 DataDescriptorGenerator (org.apache.derby.iapi.sql.dictionary.DataDescriptorGenerator)15 RawContainerHandle (org.apache.derby.iapi.store.raw.data.RawContainerHandle)15 DataTypeDescriptor (org.apache.derby.iapi.types.DataTypeDescriptor)15 Properties (java.util.Properties)14 UserType (org.apache.derby.iapi.types.UserType)13 Page (org.apache.derby.iapi.store.raw.Page)11