org.smyld.util.alias.DBAliasSource Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of smyld-main-db Show documentation
Show all versions of smyld-main-db Show documentation
This projects contains SMYLD DB
package org.smyld.util.alias;
import java.util.HashMap;
import org.smyld.db.DBConnection;
import org.smyld.db.DBSettings;
import static org.smyld.util.alias.AliasConstants.*;
public class DBAliasSource extends AliasSource {
/**
*
*/
private static final long serialVersionUID = 1L;
HashMap tables;
HashMap schemas;
DBSettings dbConnSettings;
DBConnection smyldDBConnection;
public DBAliasSource() {
super(ALIAS_SRC_TYPE_DB);
}
public DBSettings getDbConnSettings() {
return dbConnSettings;
}
public void setDbConnSettings(DBSettings dbConnSettings) {
this.dbConnSettings = dbConnSettings;
}
public HashMap getTables() {
return tables;
}
public void setTables(HashMap tables) {
this.tables = tables;
}
public void fillSchemas() {
if ((tables != null) && (tables.size() > 0)) {
schemas = new HashMap();
for (DBAliasTable curTable : tables.values()) {
String curSchema = curTable.getSchema();
if (!schemas.containsKey(curSchema))
schemas.put(curSchema, curSchema);
}
}
}
public HashMap getSchemaList() {
if ((schemas != null) && (schemas.size() > 0))
return schemas;
return null;
}
public DBConnection getRs2DBConnection() {
return smyldDBConnection;
}
public void setRs2DBConnection(DBConnection smyldDBConnection) {
this.smyldDBConnection = smyldDBConnection;
}
}