package _VisualDVM.TestingSystem.SAPFOR.SapforPackage;
import Common.Database.Objects.DBObject;
import Common.Database.Tables.FKBehaviour;
import Common.Database.Tables.FKCurrentObjectBehaviuor;
import Common.Database.Tables.FKDataBehaviour;
import Common.Database.Tables.iDBTable;
import Common.Visual.DataSetControlForm;
import _VisualDVM.TestingSystem.SAPFOR.SapforPackage.UI.SapforPackagesForm;
import _VisualDVM.TestingSystem.SAPFOR.SapforPackageConfiguration.SapforPackageConfiguration;

import javax.swing.*;
import java.util.LinkedHashMap;
public class SapforPackageDBTable extends iDBTable<SapforPackage> {
    public SapforPackageDBTable() {
        super(SapforPackage.class);
    }
    @Override
    public String getSingleDescription() {
        return "пакет";
    }
    @Override
    public String getPluralDescription() {
        return "пакеты";
    }
    @Override
    protected DataSetControlForm createUI(JPanel mountPanel) {
        return new SapforPackagesForm(this, mountPanel);
    }
    @Override
    public LinkedHashMap<Class<? extends DBObject>, FKBehaviour> getFKDependencies() {
        LinkedHashMap<Class<? extends DBObject>, FKBehaviour> res = new LinkedHashMap<>();
        res.put(SapforPackageConfiguration.class, new FKBehaviour(FKDataBehaviour.DELETE, FKCurrentObjectBehaviuor.PASSIVE));
        return res;
    }
}
