package com.app.hxqh.udkbfl;
import psdi.mbo.*;
import psdi.util.MXException;

import java.rmi.RemoteException;
/**
 * ÖªÊ¶·ÖÀàMboSet
 * edit 2023-10-12
 */
public class UdKbflMboSet extends HierarchicalMboSet implements MboSetRemote,HierarchicalMboSetRemote {


    public UdKbflMboSet(MboServerInterface ms) throws RemoteException {
        super(ms);
    }

    @Override
    protected Mbo getMboInstance(MboSet arg0) throws MXException, RemoteException {
        return new UdKbflMbo(arg0);

    }

    @Override
    public MboValueData[][] getChildren(String s, String s1, String[] strings, int i) throws MXException, RemoteException {
        setWhere("PARENT in(SELECT FLBH FROM UDKBFL WHERE UDKBFLID="+s1.replace(",", "")+")");
        this.reset();
        if (!(isEmpty())){
            return getMboValueData(0, i + 1, strings);
        }else{
            return null;
        }
    }

    @Override
    public MboValueData[] getParent(String s, String s1, String[] strings) throws MXException, RemoteException {
        setWhere(" 1=1 ");
        if (!this.isEmpty()) {
            MboRemote mbo = this.getMbo(0);
            return mbo.getMboValueData(strings);
        } else {
            return null;
        }
    }

    @Override
    public MboValueData[][] getSiblings(String s, String s1, String[] strings, int i) throws MXException, RemoteException {
        return new MboValueData[0][];
    }

    @Override
    public MboValueData[][] getTop(String[] strings, int i) throws MXException, RemoteException {
        setWhere("PARENT IS null");
        reset();
        if (!(isEmpty())){
            return getMboValueData(0, i + 1, strings);
        }else{
            return null;
        }

    }

    @Override
    public MboValueData[][] getPathToTop(String s, String s1, String[] strings, int i) throws MXException, RemoteException {
        return new MboValueData[0][];
    }

}
