* schema will be generated from the database.
*/
public SchemaGroup getSchemaGroup() {
if (_schema == null) {
if (_action.indexOf(ACTION_BUILD_SCHEMA) != -1) {
DynamicSchemaFactory factory = new DynamicSchemaFactory();
factory.setConfiguration(_conf);
_schema = factory;
} else if (_readSchema
|| contains(_schemaActions,SchemaTool.ACTION_RETAIN)
|| contains(_schemaActions,SchemaTool.ACTION_REFRESH)) {
_schema = (SchemaGroup) newSchemaTool(null).getDBSchemaGroup().
clone();
} else {
// with this we'll just read tables as different mappings
// look for them
LazySchemaFactory factory = new LazySchemaFactory();
factory.setConfiguration(_conf);
factory.setPrimaryKeys(getPrimaryKeys());
factory.setForeignKeys(getForeignKeys());
factory.setIndexes(getIndexes());
_schema = factory;
}
if (_schema.getSchemas().length == 0)
_schema.addSchema();