// The MetaData supports multiple columns and so we could extend this in the future
// to use all MetaData information.
ColumnMetaData[] versionColumnMetaData = vermd.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();
colmd.setName(id.getIdentifierName());
datastoreContainer.getVersionMetaData().addColumn(colmd);
}
else
{
// Column metadata defined
colmd = versionColumnMetaData[0];
if (colmd.getName() == null)
{
// No name defined so create one and set it
id = idFactory.newVersionFieldIdentifier();
colmd.setName(id.getIdentifierName());
}
else
{
// Name defined so just generate identifier
id = idFactory.newDatastoreFieldIdentifier(colmd.getName());