1 package ecar.dao;
2
3 import javax.servlet.http.HttpServletRequest;
4
5 import org.hibernate.HibernateException;
6
7 import comum.database.Dao;
8 import comum.util.Pagina;
9 import ecar.exception.ECARException;
10 import ecar.pojo.TipoAcompAbasSisatributoTaAbaSatb;
11 import ecar.pojo.TipoAcompAbasSisatributoTaAbaSatbId;
12 import ecar.util.Dominios;
13
14 public class TipoAcompAbasSisatributoTaAbaSatbDao extends Dao {
15
16 public TipoAcompAbasSisatributoTaAbaSatbDao() {
17
18 }
19
20 public TipoAcompAbasSisatributoTaAbaSatb buscar(Long codTa, Long codAba, Long codSatb) throws ECARException {
21 try {
22 return (TipoAcompAbasSisatributoTaAbaSatb) this.getSession().get(TipoAcompAbasSisatributoTaAbaSatb.class, new TipoAcompAbasSisatributoTaAbaSatbId(codTa, codAba, codSatb));
23 } catch (HibernateException e) {
24
25 this.logger.error(e);
26 throw new ECARException("erro.hibernateException");
27 }
28 }
29
30 public void setTipoAcompAbasSisatributoTaAbaSatb(TipoAcompAbasSisatributoTaAbaSatb taabasatb, HttpServletRequest request) {
31
32 taabasatb.setIndVisualizaAba(Pagina.getParamOrDefault(request, "tpaba" + taabasatb.getId().getCodTa() + "-" + taabasatb.getId().getCodAba() + "-" + taabasatb.getId().getCodSatb(), Dominios.SEM_ACESSO_LEITURA));
33 }
34
35 }