Package org.hibernate

Examples of org.hibernate.Query.list()


    if(fromIdx>0)
      query.setFirstResult(fromIdx);
    if(count > 0)
      query.setMaxResults(count);
    List tags = new ArrayList();
    List results = query.list();
    for(int i=0;results!=null && i<results.size();i++){
      tags.add(((Object[])results.get(i))[0]);
    }
    return tags;
  }
View Full Code Here


    Query query = getSession().createQuery(hql.toString());
    if(site!=null)
      query.setInteger(0,site.getId());
    query.setMaxResults(count);
    List tags = new ArrayList();
    List results = query.list();
    for(int i=0;results!=null && i<results.size();i++){
      tags.add(((Object[])results.get(i))[0]);
    }
    return tags;
  }
View Full Code Here

    for(i=0;i<ids.size();i++){
      int id = ((Number)ids.get(i)).intValue();
      q.setInteger(i, id);
    }
    q.setInteger(i, -1);
    return q.list();
  }
 
  /**
   * ��������
   * @param site
View Full Code Here

    Session ssn = getSession();
    Query q = ssn.getNamedQuery("SEARCH_MUSIC");
    String pattern = '%' + key + '%';
    q.setString("key", pattern);
    q.setMaxResults(20);
    List res = q.list();
    List songs = new ArrayList();
    for(int i=0;res!=null&&i<res.size();i++){
      Object[] objs = (Object[])res.get(i);
      MusicBean mbean = new MusicBean();
      mbean.setTitle((String)objs[0]);
View Full Code Here

      i=0;
      for(;i<ids.length;i++){
        q.setInteger(i+1, ids[i]);
      }
      q.setInteger(i+1, ids[0]);
      List musics = q.list();
      if(musics.size()>0){
        beginTransaction();
        //����ռ��жԸ����ֵ�����
        Query q2 = ssn.createQuery(hql2.toString());
        i=0;
View Full Code Here

      if(date>0){
        q.setInteger("date", date);
      }
      q.setFirstResult(fromIdx);
      q.setMaxResults(count);
      return q.list();
    }finally{
      hql = null;
    }
  }
 
View Full Code Here

    //q.setInteger("hidden_status", PhotoBean.STATUS_PRIVATE);
    if(fromIdx > 0)
      q.setFirstResult(fromIdx);
    if(count > 0)
      q.setMaxResults(count);
    return q.list();
  }

  /**
   * �г�����ͼƬ�����ڹ���
   * @param fromIdx
View Full Code Here

        q.setInteger("date", date);
      }
      q.setInteger("site_status", SiteBean.STATUS_NORMAL);
      q.setFirstResult(fromIdx);
      q.setMaxResults(count);
      return q.list();
    }finally{
      hql = null;
    }
  }
View Full Code Here

      if(!is_owner){
        q.setInteger("status", PhotoBean.STATUS_NORMAL);
        q.setInteger("album_type", AlbumBean.TYPE_PUBLIC);
      }
      int total = 0;
      Iterator logs = q.list().iterator();
      while(logs.hasNext()){
        tempCal.setTime((Date)logs.next());
        int date = tempCal.get(Calendar.DATE);
        logCounts[date]++;
        total ++;
View Full Code Here

    }
    if(fromIdx>0)
      q.setFirstResult(fromIdx);
    if(count>0)
      q.setMaxResults(count);
    return q.list();
  }
 
  /**
   * ��ҳ�г�ij����Ƭ������
   * @param log_id
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.