All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.digitolio.jdbi.table.Table Maven / Gradle / Ivy

There is a newer version: 0.6.8.2
Show newest version
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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy