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, Object parameter);

Source Link

Document

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

Usage

From source file:fr.cph.stock.dao.ShareValueDaoImpl.java

License:Apache License

/**
 * Get all ShareValue of a user//from   www  . ja  v a2 s.c  o m
 * 
 * @param userId
 *            a user id
 * @return a list of share value
 */
public final List<ShareValue> selectAllValue(final int userId) {
    SqlSession session = getSqlSessionFactory();
    List<ShareValue> shareValues = null;
    try {
        shareValues = session.selectList("ShareValue.selectAllValue", userId);
    } finally {
        session.close();
    }
    return shareValues;
}

From source file:gp.daoImpl.BusqPreInversionDaoImpl.java

@Override
public List<Integer> etapas(String proy) {
    List<Integer> etapas = null;
    SqlSession session = sqlSessionFactory.openSession();
    try {// w  ww .  j a va 2s . c om
        etapas = session.selectList("BusqPreInversion.listaEtapas", proy);
    } 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.BusqPreInversionDaoImpl.java

@Override
public List<MontosViables> getHistMontosViab(Integer idproy) {
    List<MontosViables> list = null;
    Map m = new HashMap();
    SqlSession session = sqlSessionFactory.openSession();
    try {/*  w w w.j a va2 s  .  com*/
        list = session.selectList("BusqPreInversion.getMontosViables", idproy);
    } 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.BusqPreInversionDaoImpl.java

@Override
public List<busquedaPreInversionMontos> getComponentesDeMonto(String montoFecha, String codigoproy) {
    List<busquedaPreInversionMontos> list = null;
    System.out.println(montoFecha + " " + codigoproy);
    Map m = new HashMap();
    m.put("montoFecha", montoFecha);
    m.put("codigo", codigoproy);
    SqlSession session = sqlSessionFactory.openSession();
    try {/*  ww w.j  a v  a 2s.c o  m*/
        list = session.selectList("BusqPreInversion.getComponenteDeMonto", m);
    } 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.BusqPreInversionDaoImpl.java

@Override
public List<busquedaPreInversionMontos> getMontoHistorial(String codigo) {
    List<busquedaPreInversionMontos> list = null;
    System.out.println(codigo);/* www .  j  a v a 2  s  .c  om*/
    SqlSession session = sqlSessionFactory.openSession();
    try {
        list = session.selectList("BusqPreInversion.getMontosHistorial", codigo);
    } 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.BusqPreInversionDaoImpl.java

@Override
public List<BusqPreInversion> listaBusqPI(String codigo) {
    SqlSession session = sqlSessionFactory.openSession();
    List<BusqPreInversion> list = null;
    try {//from  w  ww. j  a v  a 2s .  c  o m
        list = session.selectList("BusqPreInversion.getBPI", codigo);
    } 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.BusqPreInversionDaoImpl.java

@Override
public List<BusqPreInversion> listaBusqPI_2(String codigo, String etapa) {
    SqlSession session = sqlSessionFactory.openSession();
    List<BusqPreInversion> list = null;
    Map<String, String> map = new HashMap<String, String>();
    map.put("codigo", codigo);
    map.put("etapa", etapa);
    try {/*from   ww w.  ja v a 2  s  .  c  o  m*/
        list = session.selectList("BusqPreInversion.getBPI_2", map);
    } 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.BusqPreInversionDaoImpl.java

@Override
public List<BusqPreInversion> listaBusqPI_3(String codigo) {
    SqlSession session = sqlSessionFactory.openSession();
    List<BusqPreInversion> list = null;
    try {/*from  w ww . j a v  a2  s  .co m*/
        list = session.selectList("BusqPreInversion.getBPI_3", codigo);
    } 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.BusqPreInversionDaoImpl.java

@Override
public List<ComponentesMostrar> listaBusqPI_4(String codigo) {
    SqlSession session = sqlSessionFactory.openSession();
    List<ComponentesMostrar> list = null;
    try {//from   w  ww . j av  a2 s. c om
        list = session.selectList("BusqPreInversion.getBPI_4", codigo);
    } 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.BusqPreInversionDaoImpl.java

@Override
public List<MostrarFechaInicFin> fechaInic_fechaFin(String fecha1, String fecha2) {
    SqlSession session = sqlSessionFactory.openSession();
    System.out.println(fecha1 + " " + fecha2);
    Map<String, String> map = new HashMap<String, String>();
    map.put("fecha1", fecha1);
    map.put("fecha2", fecha2);
    List<MostrarFechaInicFin> list = null;
    try {//from   w  w w .  j av a2  s  .  c om
        list = session.selectList("BusqPreInversion.getBPI_5", map);
    } catch (Exception e) {
        System.out.println(e.getMessage());
        e.printStackTrace();
        System.out.println("ERROR EN EL IMPL");
    } finally {
        session.close();
    }
    return list;
}