// Currently we only use a single column mapping for versioning.
// The MetaData supports multiple columns and so we could extend this in the future
// to use all MetaData information.
ColumnMetaData[] versionColumnMetaData = versionMetaData.getColumnMetaData();
ColumnMetaData colmd;
IdentifierFactory idFactory = datastoreContainer.getStoreManager().getIdentifierFactory();
DatastoreIdentifier id = null;
if (versionColumnMetaData.length == 0)
{
// No column name so generate a default
id = idFactory.newVersionFieldIdentifier();
colmd = new ColumnMetaData(versionMetaData, id.getIdentifier());
datastoreContainer.getVersionMetaData().addColumn(colmd);
}
else
{
// Column name defined
colmd = versionColumnMetaData[0];
id = idFactory.newDatastoreFieldIdentifier(colmd.getName());
}
DatastoreField column = datastoreContainer.addDatastoreField(getType(), id, this, colmd);
datastoreContainer.getStoreManager().getMappingManager().createDatastoreMapping(delegate, datastoreContainer.getStoreManager(),
column, getType());
}