/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package sikd.ikonsol.ejb.session;

import java.util.List;
import javax.annotation.PostConstruct;
import javax.ejb.Stateless;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import sikd.ikonsol.ejb.dao.AkunEliminasiDao;
import sikd.ikonsol.model.AkunEliminasi;
import sikd.ikonsol.model.AkunResiprokal;
import sikd.ikonsol.model.HeaderDataKonsolidasi;
import sikd.ikonsol.model.RawData;
import sikd.ikonsol.model.SusunKonsolidasi;
import sikd.sikd5.sikd5ejb.session.util.MyBatisConnectionFactory;

/**
 *
 * @author Imam Bhoim
 */
@Stateless
public class AkunEliminasiEjbHomeImpl implements AkunEliminasiEjbHome {

    private SqlSessionFactory sqlSessionFactory;
    private SqlSession session = null;

    private AkunEliminasiDao dao;

    @PostConstruct
    public void init() {
        try {
            System.out.println("-------- Load MyBatis Factory IKonsol ------- ");
            sqlSessionFactory = MyBatisConnectionFactory.getSqlSessionFactoryIkonsol();
            dao = new AkunEliminasiDao(sqlSessionFactory);
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }

    @Override
    public List<AkunEliminasi> findAll() {
        return dao.findAll();
    }

    @Override
    public AkunEliminasi saveProses(AkunEliminasi obj) {
        return dao.saveProses(obj);
    }

    @Override
    public List<AkunEliminasi> selectCompare() {
        return dao.selectCompare();
    }

    @Override
    public List<AkunEliminasi> findAllByTahunBasJenisLap(int tahun, int idbas, int idjnslaporan, String kdperiode) {
        return dao.findAllByTahunBasJnsLaporan(tahun, idbas, idjnslaporan, kdperiode);
    }

    @Override
    public List<AkunEliminasi> findByKodeProvinsi(String kode, int id) {
        return dao.findKodeProvinsi(kode, id);
    }

    @Override
    public List<AkunEliminasi> selectKdProv(int idheaderdata) {
        return dao.selectKdProv(idheaderdata);
    }

    @Override
    public List<AkunResiprokal> selectResipro(int idjnslapor) {
        return dao.selectResipro(idjnslapor);
    }

    @Override
    public List<RawData> selectProvRawData(AkunResiprokal objresiprokal, SusunKonsolidasi obj2, HeaderDataKonsolidasi obj3,
            String kdpemda) {
        return dao.selectProvRawData(objresiprokal, obj2, obj3, kdpemda);
    }

    @Override
    public List<RawData> selectKabRawData(AkunResiprokal objresiprokal, SusunKonsolidasi obj2, HeaderDataKonsolidasi obj3,
            String kdpemda) {
        return dao.selectKabRawData(objresiprokal, obj2, obj3, kdpemda);
    }

    @Override
    public List<AkunEliminasi> selectKdProv1(int idheaderdata) {
        return dao.selectKdProv1(idheaderdata);
    }

    @Override
    public List<AkunResiprokal> selectResipro2(int id, String kdpemda) {
        return dao.selectResipro2(id, kdpemda);
    }

    @Override
    public AkunResiprokal selectOpsiNilai(int opsi) {
        return dao.selectOpsiNilai(opsi);
    }

    @Override
    public AkunEliminasi selectCountKabKota(int id, String kdprov, int headerid) {
        return dao.selectCountKabKota(id, kdprov, headerid);
    }

    @Override
    public AkunEliminasi updateProses(AkunEliminasi obj) {
        return dao.updateProses(obj);
    }

    @Override
    public AkunEliminasi updateEliminasi(AkunEliminasi obj) {
        return dao.updateEliminasi(obj);
//        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public AkunEliminasi selectCountFlag(String kdprov, String flag, int headerid, int idres) {
        //     throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
        return dao.selectCountFlag(kdprov, flag, headerid, idres);
    }

    @Override
    public AkunEliminasi updateEliminasiManual(AkunEliminasi obj) {
        return dao.updateEliminasiManual(obj);
    }

    @Override
    public List<AkunEliminasi> findByListNasional(String priode, int idbas, int idjenis, int tahun) {
        return dao.findAllByListNasional(priode, idbas, idjenis, tahun);
    }

    @Override
    public List<AkunEliminasi> findByListProv(String priode, int idbas, int idjenis, int tahun, String prov) {
        return dao.findAllByListProv(priode, idbas, idjenis, tahun, prov);
    }

    @Override
    public List<AkunEliminasi> findByListWilayah(String priode, int idbas, int idjenis, int tahun, String wilayah) {
        //    throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
        return dao.findAllByListWilayah(priode, idbas, idjenis, tahun, wilayah);

    }

    @Override
    public AkunEliminasi selectRefAkun2(String kdLvl1, String kdLvl2, int idres) {
        return dao.selectRefAkun2(kdLvl1, kdLvl2, idres); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public AkunEliminasi selectRefAkun1(String kdLvl1, int idres) {
        return dao.selectRefAkun1(kdLvl1, idres);
    }

    @Override
    public AkunEliminasi selectRefAkun3(String kdLvl1, String kdLvl2, String kdLvl3, int idres) {
        return dao.selectRefAkun3(kdLvl1, kdLvl2, kdLvl3, idres);
    }

    @Override
    public AkunEliminasi createNew() {
        return new AkunEliminasi();
    }
}
