/*
 * 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.HashMap;
import java.util.List;
import java.util.Map;
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.TrialBalanceDao;
import sikd.ikonsol.model.TrialBalance;
import sikd.sikd5.sikd5ejb.session.util.MyBatisConnectionFactory;

/**
 *
 * @author riyan
 */
@Stateless
public class TrialBalanceEjbHomeImpl implements TrialBalanceEjbHome {
  private SqlSessionFactory sqlSessionFactory;
    private SqlSession session = null;

    private TrialBalanceDao dao;

    @PostConstruct
    public void init() {
        try {
            System.out.println("-------- Load MyBatis Factory IKonsol ------- ");
            sqlSessionFactory = MyBatisConnectionFactory.getSqlSessionFactoryIkonsol();
            dao = new TrialBalanceDao(sqlSessionFactory);
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
    @Override
    public List<TrialBalance> findAll() {
        //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    return dao.findAll();
    }

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

    @Override
    public List<TrialBalance> findAllByTahunKode(int tahun, String kodePemda,int idbas,String kodePeriode) {
         return dao.findAllByTahunKode(tahun,kodePemda,idbas,kodePeriode);
    }

    @Override
    public List<TrialBalance> findAllByTahunKodeDetail(String kdrek1, 
            String kdrek2,String kdrek3,int tahun, String kodePemda,int idbas,String kodePeriode) {
     //   throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
        return dao.findAllByTahunKodeDetail(kdrek1,kdrek2,kdrek3,tahun,kodePemda,idbas,kodePeriode);
     }

    @Override
    public List<TrialBalance> findAllByTahunKodeSum(int tahun, String kodePemda,int idbas,String kodePeriode) {
     return dao.findAllByTahunKodeSum(tahun,kodePemda,idbas,kodePeriode);
   }

    @Override
    public List<TrialBalance> findAllByTahunKode2(String kdrek1, int tahun, String kodePemda, int idbas, String kodePeriode) {
   return dao.findAllByTahunKode2(kdrek1,tahun,kodePemda,idbas,kodePeriode);}

    @Override
    public List<TrialBalance> findAllByTahunKode3(String kdrek1, String kdrek2, int tahun, String kodePemda, int idbas, String kodePeriode) {
 return dao.findAllByTahunKode3(kdrek1,kdrek2,tahun,kodePemda,idbas,kodePeriode);}

    @Override
    public List<TrialBalance> findAllByTahunKode4(String kdrek1, String kdrek2, String kdrek3, int tahun, String kodePemda, int idbas, String kodePeriode) {
 return dao.findAllByTahunKode4(kdrek1,kdrek2,kdrek3,tahun,kodePemda,idbas,kodePeriode);}

        
    
    
}
