package _VisualDVM.GlobalData.SapforProfile;
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.GlobalData.SapforProfile.UI.SapforProfilesForm;
import _VisualDVM.GlobalData.SapforProfileSetting.SapforProfileSetting;

import javax.swing.*;
import java.util.LinkedHashMap;
public class SapforProfilesDBTable extends iDBTable<SapforProfile> {
    public SapforProfilesDBTable() {
        super(SapforProfile.class);
    }
    @Override
    public String getPluralDescription() {
        return "профили SAPFOR";
    }
    @Override
    public String getSingleDescription() {
        return "профиль SAPFOR";
    }
    @Override
    protected DataSetControlForm createUI(JPanel mountPanel) {
        return new SapforProfilesForm(this, mountPanel);
    }
    @Override
    public LinkedHashMap<Class<? extends DBObject>, FKBehaviour> getFKDependencies() {
        LinkedHashMap<Class<? extends DBObject>, FKBehaviour> res = new LinkedHashMap<>();
        res.put(SapforProfileSetting.class, new FKBehaviour(FKDataBehaviour.DELETE, FKCurrentObjectBehaviuor.ACTIVE));
        return res;
    }
}
