Examples of uniqueResult()


Examples of org.hibernate.Query.uniqueResult()

      if(album_id > 0)
        q.setInteger("album", album_id);
      if(!is_owner)
        q.setInteger("album_type", AlbumBean.TYPE_PUBLIC);     
      q.setMaxResults(1);
      return (PhotoOutlineBean)q.uniqueResult();
    }finally{
      hql = null;
    }
  }
View Full Code Here

Examples of org.hibernate.Query.uniqueResult()

      if(album_id > 0)
        q.setInteger("album", album_id);
      if(!site.isOwner(user))
        q.setInteger("album_type", AlbumBean.TYPE_PUBLIC);     
      q.setMaxResults(1);
      return (PhotoOutlineBean)q.uniqueResult();
    }finally{
      hql = null;
    }
  }
 
View Full Code Here

Examples of org.hibernate.Query.uniqueResult()

        q.setInteger("public_album", AlbumBean.TYPE_PUBLIC);
      }
      if(date>0){
        q.setInteger("date", date);
      }
      return ((Number)q.uniqueResult()).intValue();
    }finally{
      hql = null;
    }
  }
 
View Full Code Here

Examples of org.hibernate.Query.uniqueResult()

    Query q = ssn.createQuery(hql.toString());
    q.setInteger(0, sid);
    if(album_id > 0)
      q.setInteger(1, album_id);
    try{
      Number size = (Number)q.uniqueResult();
      return (size!=null)?size.intValue():0;
    }finally{
      hql = null;
    }
  }
View Full Code Here

Examples of org.hibernate.Query.uniqueResult()

    if(month >= 190001 && month <= 209912){
      q.setInteger("year", month / 100);
      q.setInteger("month", month % 100);
    }
    try{
      Number size = (Number)q.uniqueResult();
      return (size!=null)?size.intValue():0;
    }finally{
      hql = null;
    }
  }
View Full Code Here

Examples of org.hibernate.Query.uniqueResult()

  public long count(final String qname,
      final Map<String, Object> parameters) {
    final Query query = this.createQuery(this.getFullQueryName(qname,
        BaseEntityManager.COUNT_SUFFIX));
    this.fittingQuery(query, parameters);
    final Object result = query.uniqueResult();
    if (result instanceof BigInteger) {
      return ((BigInteger) result).longValue();
    } else {
      return ((Long) result).longValue();
    }
View Full Code Here

Examples of org.hibernate.Query.uniqueResult()

  public long count(final String qname,
      final Object... parameters) {
    final Query query = this.createQuery(this.getFullQueryName(qname,
        BaseEntityManager.COUNT_SUFFIX));
    this.fittingQuery(query, parameters);
    final Object result = query.uniqueResult();
    if (result instanceof BigInteger) {
      return ((BigInteger) result).longValue();
    } else {
      return ((Long) result).longValue();
    }
View Full Code Here

Examples of org.hibernate.Query.uniqueResult()

      final Map<String, Object> parameters) {
    final Query query = this.createQuery(this.getFullQueryName(qname,
        BaseEntityManager.LOAD_SUFFIX));
    this.fittingQuery(query, parameters);
    try {
      return (E) query.uniqueResult();
    } catch (Exception e) {
      return null;
    }
  }
View Full Code Here

Examples of org.hibernate.Query.uniqueResult()

  public E load(final String qname, final Object... parameters) {
    final Query query = this.createQuery(this.getFullQueryName(qname,
        BaseEntityManager.LOAD_SUFFIX));
    this.fittingQuery(query, parameters);
    try {
      return (E) query.uniqueResult();
    } catch (Exception e) {
      return null;
    }
  }
View Full Code Here

Examples of org.hibernate.Query.uniqueResult()

      query = this.session.createQuery(this.buildDynamicSQL(parameters,
          true, scope));
      // 处理参数
      this.fittingQuery(query, parameters);
      // 获取记录总数
      recordAmount = Integer.parseInt(query.uniqueResult().toString());
    }

    // 构造动态查询的统计SQL语句
    query = this.session.createQuery(this.buildDynamicSQL(parameters,
        false, scope));
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.