Example usage for org.apache.ibatis.session SqlSession selectList

List of usage examples for org.apache.ibatis.session SqlSession selectList

Introduction

In this page you can find the example usage for org.apache.ibatis.session SqlSession selectList.

Prototype

<E> List<E> selectList(String statement);

Source Link

Document

Retrieve a list of mapped objects from the statement key and parameter.

Usage

From source file:gp.daoImpl.BusqPreInversionDaoImpl.java

@Override
public List<MostrarDesdeDependencias> mostrarDesdeDepesyFacus() {
    SqlSession session = sqlSessionFactory.openSession();
    List<MostrarDesdeDependencias> list = null;
    try {/*from  w  ww  . j  a va  2 s  . c  o  m*/
        list = session.selectList("BusqPreInversion.getBPI_9");
    } catch (Exception e) {
        System.out.println(e.getMessage());
        e.printStackTrace();
        System.out.println("ERROR EN EL IMPL");
    } finally {
        session.close();
    }
    return list;
}

From source file:gp.daoImpl.gestionUsuarioDaoImpl.java

@Override
public List<listarUsuarios> listarUsuario() {
    List<listarUsuarios> etapas = null;
    SqlSession session = sqlSessionFactory.openSession();
    try {/*from   ww  w. j a v  a2  s  . c  o m*/
        etapas = session.selectList("UsuarioData.lista_usuarios");
    } catch (Exception e) {
        System.out.println(e.getMessage());
        System.out.println("ERROR EN EL IMPL getnumonto");
    } finally {
        session.close();
    }
    return etapas;
}

From source file:gp.daoImpl.ListasGeneralesDaoImpl.java

@Override
public List<MostrarAPG> getProyeco2() {
    SqlSession session = sqlSessionFactory.openSession();
    List<MostrarAPG> ag = null;
    try {//from w ww  . j av  a  2 s .  c o  m
        ag = session.selectList("ListasGenerales.getAspectosGenerales2");
    } catch (Exception e) {
        System.out.println(e.getMessage());
        e.printStackTrace();
    } finally {
        session.close();
    }
    return ag;
}

From source file:gp.daoImpl.ListasGeneralesDaoImpl.java

@Override
public List<String> getExpedientes() {
    SqlSession session = sqlSessionFactory.openSession();
    List<String> list = null;
    try {// w  ww.j  av  a  2s .co m
        list = session.selectList("ListasGenerales.getExpedientes");
    } catch (Exception e) {
        System.out.println(e.getMessage());
        e.printStackTrace();
        System.out.println("ERROR EN EL IMPL");
    } finally {
        session.close();
    }
    return list;
}

From source file:gp.daoImpl.ListasGeneralesDaoImpl.java

@Override
public List<String> getResoluciones() {
    SqlSession session = sqlSessionFactory.openSession();
    List<String> list = null;
    try {/*from   www  .j av a2 s  .  co m*/
        list = session.selectList("ListasGenerales.getResoluciones");
    } catch (Exception e) {
        System.out.println(e.getMessage());
        e.printStackTrace();
        System.out.println("ERROR EN EL IMPL");
    } finally {
        session.close();
    }
    return list;
}

From source file:gp.daoImpl.ListasGeneralesDaoImpl.java

@Override
public List<String> getInformes() {
    SqlSession session = sqlSessionFactory.openSession();
    List<String> list = null;
    try {/*  ww w  .  j  a v a 2 s . c  om*/
        list = session.selectList("ListasGenerales.getInformesOPYP");
    } catch (Exception e) {
        System.out.println(e.getMessage());
        e.printStackTrace();
        System.out.println("ERROR EN EL IMPL");
    } finally {
        session.close();
    }
    return list;
}

From source file:gp.daoImpl.ListasGeneralesDaoImpl.java

@Override
public List<String> getTipoUsuario() {
    SqlSession session = sqlSessionFactory.openSession();
    List<String> list = null;
    try {//from   ww  w .  j  av a 2  s. c  o m
        list = session.selectList("ListasGenerales.getiposUsuarios");
    } catch (Exception e) {
        System.out.println(e.getMessage());
        e.printStackTrace();
        System.out.println("ERROR EN EL IMPL");
    } finally {
        session.close();
    }
    return list;
}

From source file:gp.daoImpl.RegistroPreInversionDaoImpl.java

@Override
public List<Opi_responsable> obtenerLista_opi() {
    List<Opi_responsable> list = null;
    SqlSession session = sqlSessionFactory.openSession();
    try {/*from www . j  a v a  2  s .  c  om*/
        list = session.selectList("RegistroPreInversion.getOpi");
    } catch (Exception e) {
        System.out.println(e.getMessage());
        System.out.println("ERROR EN EL IMPL");
    } finally {
        session.close();
    }
    return list;
}

From source file:gp.daoImpl.RegistroPreInversionDaoImpl.java

@Override
public List<Nivel_Estudio> obtenerList_nivEst() {
    List<Nivel_Estudio> list = null;
    SqlSession session = sqlSessionFactory.openSession();
    try {//from w  w  w. j av a2  s  .  co m
        list = session.selectList("RegistroPreInversion.getNivEst");
    } catch (Exception e) {
        System.out.println(e.getMessage());
        System.out.println("ERROR EN EL IMPL");
    } finally {
        session.close();
    }
    return list;
}

From source file:mybatis.client.MyFrame.java

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed

    SqlSession ss = factory.openSession(true);

    d_lists = ss.selectList("dept.all");

    dept_ar = new String[d_lists.size()];

    //d_lists.toArray(dept_ar);

    int i = 0, j = 0;

    for (DeptVO dvo : d_lists) {
        List<EmpVO> e_list = dvo.getE_list();
        dept_ar[i++] = dvo.getDepartment_name() + "-(" + e_list.size() + ")";
    }//from   w  w w .j  av  a 2 s .co m

    System.out.println("lists :" + d_lists.size());
    ss.close();

    jList1.setModel(new AbstractListModel<String>() {
        @Override
        public int getSize() {
            return dept_ar.length;
        }

        @Override
        public String getElementAt(int index) {
            return dept_ar[index];
        }
    });
}