assertIsUninitialized();
IdentifierFactory idFactory = storeMgr.getIdentifierFactory();
MappingManager mapMgr = getStoreManager().getMappingManager();
classMapping = mapMgr.getMapping(String.class);
Column class_column=(Column) addDatastoreField(String.class.getName(),
idFactory.newDatastoreFieldIdentifier("CLASS_NAME"), classMapping, null);
mapMgr.createDatastoreMapping(classMapping, class_column, String.class.getName());
class_column.getColumnMetaData().setLength(128);
class_column.getColumnMetaData().setJdbcType("VARCHAR");
class_column.setAsPrimaryKey();
tableMapping = mapMgr.getMapping(String.class);
Column table_column=(Column) addDatastoreField(String.class.getName(),
idFactory.newDatastoreFieldIdentifier("TABLE_NAME"), tableMapping, null);
mapMgr.createDatastoreMapping(tableMapping, table_column, String.class.getName());
table_column.getColumnMetaData().setLength(128);
table_column.getColumnMetaData().setJdbcType("VARCHAR");
typeMapping = mapMgr.getMapping(String.class);
Column type_column=(Column) addDatastoreField(String.class.getName(),
idFactory.newDatastoreFieldIdentifier("TYPE"), typeMapping, null);
mapMgr.createDatastoreMapping(typeMapping, type_column, String.class.getName());
type_column.getColumnMetaData().setLength(4);
type_column.getColumnMetaData().setJdbcType("VARCHAR");
// TODO Change type to SMALLINT/BIT
ownerMapping = mapMgr.getMapping(String.class);
Column owner_column=(Column) addDatastoreField(String.class.getName(),
idFactory.newDatastoreFieldIdentifier("OWNER"), ownerMapping, null);
mapMgr.createDatastoreMapping(ownerMapping, owner_column, String.class.getName());
owner_column.getColumnMetaData().setLength(2);
owner_column.getColumnMetaData().setJdbcType("VARCHAR");
versionMapping = mapMgr.getMapping(String.class);
Column version_column=(Column) addDatastoreField(String.class.getName(),
idFactory.newDatastoreFieldIdentifier("VERSION"), versionMapping, null);
mapMgr.createDatastoreMapping(versionMapping, version_column, String.class.getName());
version_column.getColumnMetaData().setLength(20);
version_column.getColumnMetaData().setJdbcType("VARCHAR");
interfaceNameMapping = mapMgr.getMapping(String.class);
Column interfaceName_column=(Column) addDatastoreField(String.class.getName(),
idFactory.newDatastoreFieldIdentifier("INTERFACE_NAME"), interfaceNameMapping, null);
mapMgr.createDatastoreMapping(interfaceNameMapping, interfaceName_column, String.class.getName());
interfaceName_column.getColumnMetaData().setLength(255);
interfaceName_column.getColumnMetaData().setJdbcType("VARCHAR");
interfaceName_column.setNullable();
// Set up JDBC statements for supported operations
insertStmt = "INSERT INTO " + identifier.getFullyQualifiedName(false) + " (" + class_column.getIdentifier() + "," + table_column.getIdentifier() + "," + type_column.getIdentifier() + "," +
owner_column.getIdentifier() + "," + version_column.getIdentifier() + "," + interfaceName_column.getIdentifier() + ") VALUES (?,?,?,?,?,?)";
deleteStmt = "DELETE FROM " + identifier.getFullyQualifiedName(false) + " WHERE " + idFactory.getIdentifierInAdapterCase("CLASS_NAME") + "=?";
deleteAllStmt = "DELETE FROM " + identifier.getFullyQualifiedName(false);
fetchAllStmt = "SELECT " + class_column.getIdentifier() + "," + table_column.getIdentifier() + "," + type_column.getIdentifier() + "," +
owner_column.getIdentifier() + "," + version_column.getIdentifier() + "," + interfaceName_column.getIdentifier() + " FROM " + identifier.getFullyQualifiedName(false) + " ORDER BY " + table_column.getIdentifier();
fetchStmt = "SELECT 1 FROM " + identifier.getFullyQualifiedName(false) + " WHERE " + idFactory.getIdentifierInAdapterCase("CLASS_NAME") + " = ? ";
state = TABLE_STATE_INITIALIZED;
}