View Javadoc

1   package ecar.dao;
2   
3   import java.util.List;
4   
5   import javax.servlet.http.HttpServletRequest;
6   
7   import comum.database.Dao;
8   
9   import ecar.exception.ECARException;
10  import ecar.pojo.PrioridadePrior;
11  
12  /**
13   * Classe de manipulação de objetos da classe AtributoAtt.
14   * @author CodeGenerator - Esta classe foi gerada automaticamente
15   * @since 1.0
16   * @version 1.0, Fri Jan 27 07:54:28 BRST 2006
17   */
18  public class PrioridadeDao extends Dao {
19    /**
20     * Construtor. Chama o Session factory do Hibernate
21     */
22    public PrioridadeDao(HttpServletRequest request) {
23      super();
24      this.request = request;
25    }
26  
27    /**
28     * verifica prioridade depois exclui
29     * @param prior
30     * @throws ECARException
31     */
32    public void excluir(PrioridadePrior prior) throws ECARException {
33      try {
34        boolean excluir = true;
35        if (contar(prior.getRegDemandaRegds()) > 0) {
36          excluir = false;
37          throw new ECARException("prioridade.exclusao.erro.regDemandaRegds");
38        }
39        if (excluir)
40          super.excluir(prior);
41      } catch (ECARException e) {
42        this.logger.error(e);
43        throw e;
44      }
45    }
46  
47    /**
48     * Busca
49     * @return List
50     * @throws ECARException
51     */
52    public List buscar() throws ECARException {
53      return super.listar((new PrioridadePrior()).getClass(), new String[] { "descricaoPrior", Dao.ORDEM_ASC });
54    }
55  }