this.tableName = tableName;
}
public void initDatabase(DbConnection con) throws Exception {
DbTable table = clazz.getAnnotation(DbTable.class);
if (tableName != null) {
name = tableName;
} else
if (table == null || MString.isEmptyTrim(table.tableName())) {
name = clazz.getSimpleName();
} else {
name = table.tableName();
}
if (table != null &&!MString.isEmptyTrim(table.attributes())) {
attributes = MConfigFactory.getInstance().toConfig(table.attributes());
} else {
attributes = new HashConfig();
}
tableNameOrg = schema.getTableName(name);
tableName = manager.getPool().getDialect().normalizeTableName(tableNameOrg);
log().t("new table",name,tableName);
parseFields();
// features
if (table != null && !MString.isEmptyTrim(table.features())) {
for (String featureName : MString.split(table.features(),",")) {
Feature feature = manager.getSchema().createFeature(manager, this, featureName);
if (feature != null) features.add(feature);
}
}