@SuppressWarnings("unchecked")
 public List<Gestion> findAllByEmpresa(Empresa empresa) {
   String query =
       "select em from Gestion em  where em.empresa.id="
           + empresa.getId()
           + " order by em.gestion desc";
   log.info("Query Gestion: " + query);
   return em.createQuery(query).getResultList();
 }
 public Gestion findByGestionEmpresa(Integer gestion, Empresa empresa) {
   String query =
       "select em from Gestion em where em.gestion="
           + gestion
           + " and em.empresa.id="
           + empresa.getId();
   log.info("Query Gestion: " + query);
   return (Gestion) em.createQuery(query).getSingleResult();
 }