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

com.fastchar.extjs.core.database.FastExtLinkInfo Maven / Gradle / Ivy

Go to download

FastChar-ExtJs is a Java Web framework that uses extjs libraries.Quickly build a background management system

There is a newer version: 2.2.2
Show newest version
package com.fastchar.extjs.core.database;

import com.fastchar.core.FastChar;
import com.fastchar.core.FastMapWrap;
import com.fastchar.database.info.FastColumnInfo;
import com.fastchar.database.info.FastDatabaseInfo;
import com.fastchar.database.info.FastTableInfo;

import java.util.LinkedHashMap;
import java.util.LinkedHashSet;

public class FastExtLinkInfo extends LinkedHashMap {

    protected transient FastMapWrap mapWrap;

    public FastExtLinkInfo() {
        super(16);
        mapWrap = FastMapWrap.newInstance(this);
    }

    public FastMapWrap getMapWrap() {
        return mapWrap;
    }

    public FastExtLinkInfo setDatabase(String database) {
        put("database", database);
        return this;
    }
    public String getDatabase() {
        return mapWrap.getString("database");
    }

    public String getTableName() {
        return mapWrap.getString("tableName");
    }

    public FastExtLinkInfo setTableName(String tableName) {
        put("tableName", tableName);
        return this;
    }

    public String getKeyColumnName() {
        return mapWrap.getString("keyColumnName");
    }

    public FastExtLinkInfo setKeyColumnName(String keyColumnName) {
        put("keyColumnName", keyColumnName);
        return this;
    }

    public FastColumnInfo getKeyColumn() {
        return getTableInfo().getColumnInfo(getKeyColumnName());
    }

    public FastExtLinkInfo addTextColumnName(String textColumnName) {
        getTextColumnNames().add(textColumnName);
        return this;
    }

    public LinkedHashSet getTextColumnNames() {
        LinkedHashSet textColumnNames = mapWrap.getObject("textColumnNames");
        if (textColumnNames == null) {
            textColumnNames = new LinkedHashSet<>(16);
            put("textColumnNames", textColumnNames);
        }
        return textColumnNames;
    }

    public FastColumnInfo getTextColumnInfo(String textColumnName) {
        return getTableInfo().getColumnInfo(textColumnName);
    }

    public FastTableInfo getTableInfo() {
        FastDatabaseInfo databaseInfo = FastChar.getDatabases().get(getDatabase());
        return databaseInfo.getTableInfo(getTableName());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy