int columnNumber;
String columnName;
String defaultID;
DefaultInfoImpl defaultInfo = null;
ColumnDescriptor colDesc;
BaseTypeIdImpl typeId;
TypeId wrapperTypeId;
DataValueDescriptor defaultValue = null;
UUID defaultUUID = null;
UUID uuid = null;
UUIDFactory uuidFactory = getUUIDFactory();
long autoincStart, autoincInc;
DataDescriptorGenerator ddg = dd.getDataDescriptorGenerator();
/*
** We're going to be getting the UUID for this sucka
** so make sure it is a UniqueTupleDescriptor.
*/
if (parentTupleDescriptor != null)
{
if (SanityManager.DEBUG)
{
if (!(parentTupleDescriptor instanceof UniqueTupleDescriptor))
{
SanityManager.THROWASSERT(parentTupleDescriptor.getClass().getName()
+ " not instanceof UniqueTupleDescriptor");
}
}
uuid = ((UniqueTupleDescriptor)parentTupleDescriptor).getUUID();
}
else
{
/* 1st column is REFERENCEID (char(36)) */
uuid = uuidFactory.recreateUUID(row.getColumn(SYSCOLUMNS_REFERENCEID).
getString());
}
/* NOTE: We get columns 5 and 6 next in order to work around
* a 1.3.0 HotSpot bug. (#4361550)
*/
// 5th column is COLUMNDEFAULT (serialiazable)
Object object = row.getColumn(SYSCOLUMNS_COLUMNDEFAULT).getObject();
if (object instanceof DataValueDescriptor)
{
defaultValue = (DataValueDescriptor) object;
}
else if (object instanceof DefaultInfoImpl)
{
defaultInfo = (DefaultInfoImpl) object;
defaultValue = defaultInfo.getDefaultValue();
}
/* 6th column is DEFAULTID (char(36)) */
defaultID = row.getColumn(SYSCOLUMNS_COLUMNDEFAULTID).getString();
if (defaultID != null)
{
defaultUUID = uuidFactory.recreateUUID(defaultID);
}
/* 2nd column is COLUMNNAME (varchar(128)) */
columnName = row.getColumn(SYSCOLUMNS_COLUMNNAME).getString();
/* 3rd column is COLUMNNUMBER (int) */
columnNumber = row.getColumn(SYSCOLUMNS_COLUMNNUMBER).getInt();
/* 4th column is COLUMNDATATYPE */
/*
** What is stored in the column is a TypeDescriptorImpl, which
** points to a BaseTypeIdImpl. These are simple types that are
** intended to be movable to the client, so they don't have
** the entire implementation. We need to wrap them in DataTypeServices
** and TypeId objects that contain the full implementations for
** language processing.
*/
TypeDescriptorImpl typeDescriptor = (TypeDescriptorImpl) row.getColumn(SYSCOLUMNS_COLUMNDATATYPE).
getObject();
typeId = typeDescriptor.getTypeId();
/*
** The BaseTypeIdImpl tells what type of TypeId it is supposed to
** be wrapped in.
*/
wrapperTypeId =
(TypeId) Monitor.newInstanceFromIdentifier(typeId.wrapperTypeFormatId());
/* Wrap the BaseTypeIdImpl in a full type id */
wrapperTypeId.setNestedTypeId(typeId);
/* Wrap the TypeDescriptorImpl in a full DataTypeDescriptor */
DataTypeDescriptor dataTypeServices = new DataTypeDescriptor(typeDescriptor,