Examples of uniqueResult()


Examples of org.hibernate.Criteria.uniqueResult()

    session.beginTransaction();
   
    Criteria criteria = session.createCriteria(Proyecto.class)
    .add(Restrictions.eq("nombre", nombre));
   
    proyecto = (Proyecto) criteria.uniqueResult();
   
    session.close();
   
    return proyecto;
  }
View Full Code Here

Examples of org.hibernate.Criteria.uniqueResult()

    session.beginTransaction();
   
    Criteria criteria = session.createCriteria(Proyecto.class)
    .add(Restrictions.eq("id", id));

    proyecto = (Proyecto) criteria.uniqueResult();
   
    session.close();
   
    return proyecto;
  }
View Full Code Here

Examples of org.hibernate.Criteria.uniqueResult()

    session.beginTransaction();
   
    Criteria criteria = session.createCriteria(Usuario.class)
    .add(Restrictions.eq("nombre", nombre));
   
    user = (Usuario) criteria.uniqueResult();
   
    session.close();
   
    return user;
    }
View Full Code Here

Examples of org.hibernate.Query.uniqueResult()

        q.setInteger("type", CatalogBean.TYPE_OWNER);
        if(user != null)
          q.setInteger("user", user.getId());
      }
      q.setMaxResults(1);
      return (DiaryOutlineBean)q.uniqueResult();
    }finally{
      hql = null;
    }
  }
View Full Code Here

Examples of org.hibernate.Query.uniqueResult()

        q.setInteger("type", CatalogBean.TYPE_OWNER);
        if(user != null)
          q.setInteger("user", user.getId());
      }
      q.setMaxResults(1);
      return (DiaryOutlineBean)q.uniqueResult();
    }finally{
      hql = null;
    }
  }
 
View Full Code Here

Examples of org.hibernate.Query.uniqueResult()

      if(year > 0 || month > 0 || date > 0){
        Calendar[] cals = genTimeParams(year,month,date);
        q.setTimestamp("beginTime", cals[0].getTime());
        q.setTimestamp("endTime", cals[1].getTime());
      }
      return ((Number) q.uniqueResult()).intValue();
    } finally {
      hql = null;
    }
  }
 
View Full Code Here

Examples of org.hibernate.Query.uniqueResult()

      if(user != null){
        q.setInteger(3, CatalogBean.TYPE_OWNER);
        q.setInteger(4, user.getId());
      }
    }
    return ((Number)q.uniqueResult()).intValue();
  }

  /**
   * ����ָ��վ����ռ���������
   * @param site
View Full Code Here

Examples of org.hibernate.Query.uniqueResult()

    Query q = ssn.createQuery(hql);
    for(int i=0;args!=null&&i<args.length;i++){
      q.setParameter(i, args[i]);
    }
    q.setMaxResults(1);
    return q.uniqueResult();
  }

  /**
   * ִ��ͳ�Ʋ�ѯ���
   * @param hql
View Full Code Here

Examples of org.hibernate.Query.uniqueResult()

    Query q = ssn.getNamedQuery(hql);
    for(int i=0;args!=null&&i<args.length;i++){
      q.setParameter(i, args[i]);
    }
    q.setMaxResults(1);
    return q.uniqueResult();
  }

  protected static Object namedUniqueResult(String hql, int parm1){
    return namedUniqueResult(hql, new Object[]{new Integer(parm1)});
  }
View Full Code Here

Examples of org.hibernate.Query.uniqueResult()

    q.setInteger("top_elite", TopicBean.INFO_TYPE_TOP_ELITE);
    if(site!=null)
      q.setInteger("site", site.getId());
    if(fbean!=null)
      q.setInteger("forum", fbean.getId());   
    return ((Number)q.uniqueResult()).intValue();
  }
 
  /**
   * �г�������
   * @param site
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.