this.cfm = cfm;
if (cfm.getKeyValidator() instanceof CompositeType)
{
this.hasCompositeKey = true;
CompositeType keyComposite = (CompositeType)cfm.getKeyValidator();
assert keyComposite.types.size() > 1;
for (int i = 0; i < keyComposite.types.size(); i++)
{
ColumnIdentifier id = getKeyId(cfm, i);
this.keys.put(id, new Name(cfm.ksName, cfm.cfName, id, Name.Kind.KEY_ALIAS, i, keyComposite.types.get(i)));
}
}
else
{
this.hasCompositeKey = false;
ColumnIdentifier id = getKeyId(cfm, 0);
this.keys.put(id, new Name(cfm.ksName, cfm.cfName, id, Name.Kind.KEY_ALIAS, 0, cfm.getKeyValidator()));
}
if (cfm.comparator instanceof CompositeType)
{
this.isComposite = true;
CompositeType composite = (CompositeType)cfm.comparator;
/*
* We are a "sparse" composite, i.e. a non-compact one, if either:
* - the last type of the composite is a ColumnToCollectionType
* - or we have one less alias than of composite types and the last type is UTF8Type.
*