File size: 1,408 Bytes
c574d3a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
/*
* 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 model.dao;
import java.util.ArrayList;
import java.util.List;
import beans.Aseguradora;
import model.MyBatisUtils;
import org.apache.ibatis.session.SqlSession;
/**
*
* @author Juan Carlos
*/
public class AseguradoraDAO {
public static List<Aseguradora> getAseguradoras(){
List<Aseguradora> list = new ArrayList<>();
SqlSession conn = null;
try{
conn = MyBatisUtils.getSession();
list = conn.selectList("Aseguradora.getAseguradoras");
}catch(Exception ex){
ex.printStackTrace();
}finally{
if(conn != null){
conn.close();
}
}
return list;
}
public static Aseguradora getAseguradora(int idAseguradora){
Aseguradora aseguradora = new Aseguradora();
SqlSession conn = null;
try{
conn = MyBatisUtils.getSession();
aseguradora = conn.selectOne("Aseguradora.getAseguradora",idAseguradora);
}catch(Exception ex){
ex.printStackTrace();
}finally{
if(conn != null){
conn.close();
}
}
return aseguradora;
}
}
|