com.digitolio.jdbi.table.Table Maven / Gradle / Ivy
package com.digitolio.jdbi.table;
import java.util.HashMap;
import java.util.Map;
public final class Table {
private final String tableDb;
private final Map primaryKeys;
private final Map nonPrimaryKeys;
private final Map columns;
public Table(String tableDb, Map primaryKeys, Map columns) {
this.tableDb = tableDb;
this.primaryKeys = primaryKeys;
this.columns = columns;
nonPrimaryKeys = diffMaps(columns, primaryKeys);
}
private Map diffMaps(Map columns, Map primaryKeys) {
HashMap map= new HashMap(columns);
for (String s : primaryKeys.keySet()) {
map.remove(s);
}
return map;
}
public String getTableDb() {
return tableDb;
}
public Map getPrimaryKeys() {
return primaryKeys;
}
public Map getColumns() {
return columns;
}
public Map getNonPrimaryKeys() {
return nonPrimaryKeys;
}
}