package _VisualDVM.TestingSystem.DVM.DVMPackage;
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.DVM.DVMPackage.UI.DVMPackagesForm;
import _VisualDVM.TestingSystem.DVM.DVMPackageConfiguration.DVMPackageConfiguration;

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