Package br.gov.serpro.ouvidoria.dao

Examples of br.gov.serpro.ouvidoria.dao.Dao


   *
   * @see br.gov.serpro.ouvidoria.dao.DaoFactory#create(java.lang.Class)
   */
  public Dao create(Class clazz) {

    Dao dao = (Dao) mapDao.get(clazz);

    if (dao == null) {
      dao = new HibernateDao(clazz);
      mapDao.put(clazz, dao);
    }
View Full Code Here


   * @throws DaoException
   */
  public Funcionario getOuvidorOrgao(final Orgao orgao) throws DaoException {

    final DaoFactory daoFactory = new HibernateDaoFactory();
    Dao funcionarioDao = daoFactory.create(Funcionario.class);

    Funcionario funcionario = new Funcionario();

    String sql = " select f from Orgao o, Funcionario as f "
        + " where o.id = " + orgao.getId() + " and f.instituicao = "
        + orgao.getId() + " and f.perfil = 1 ";

    funcionario = (Funcionario) funcionarioDao.query(sql).get(0);

    return funcionario;
  }
View Full Code Here

   * @return
   * @throws DaoException
   */
  public Collection listas(final Long[] ids, final Class pClass)
      throws DaoException {
    Dao dao = daoFactory.create(pClass);
    Collection lista = new HashSet();
    for (int i = 0; ids != null && i < ids.length; i++) {
      lista.add(dao.get(ids[i]));
    }
    return lista;
  }
View Full Code Here

TOP

Related Classes of br.gov.serpro.ouvidoria.dao.Dao

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.