1 package ecar.dao;
2
3 import java.util.Iterator;
4 import java.util.List;
5
6 import javax.servlet.http.HttpServletRequest;
7
8 import comum.database.Dao;
9
10 import ecar.exception.ECARException;
11 import ecar.pojo.ModeloRelatorioMrel;
12
13
14
15
16
17
18
19 public class ModeloRelatorioMrelDAO extends Dao {
20
21
22
23 public ModeloRelatorioMrelDAO(HttpServletRequest request) {
24 super();
25 this.request = request;
26 }
27
28
29
30
31
32
33 public ModeloRelatorioMrel getModeloRelatorioByCodAlfa(String codAlfa) throws ECARException {
34 ModeloRelatorioMrel retorno = null;
35 List modelos = this.listar(ModeloRelatorioMrel.class, new String[] { "codAlfaMrel", "asc" });
36
37 if (modelos != null && !modelos.isEmpty()) {
38 Iterator it = modelos.iterator();
39 while (it.hasNext()) {
40 ModeloRelatorioMrel mrel = (ModeloRelatorioMrel) it.next();
41 if (codAlfa.equalsIgnoreCase(mrel.getCodAlfaMrel())) {
42 retorno = mrel;
43 break;
44 }
45 }
46 }
47
48 return retorno;
49 }
50 }