Examples of createQuery()


Examples of org.hibernate.Session.createQuery()

    }
   
    private void updateProcessLog(long processInstanceId) {
        Session session = HibernateUtil.getSessionFactory().getCurrentSession();
        session.beginTransaction();
        List<ProcessInstanceLog> result = session.createQuery(
        "from ProcessInstanceLog as log where log.processInstanceId = ? and log.end is null")
            .setLong(0, processInstanceId).list();
        if (result != null && result.size() != 0) {
          ProcessInstanceLog log = result.get(result.size() - 1);
          log.setEnd(new Date());
View Full Code Here

Examples of org.hibernate.Session.createQuery()

      hql.append(" AND t.site.id=:site");
    if(fbean!=null)
      hql.append(" AND t.forum.id=:forum");
    hql.append(" AND (t.type=:elite OR t.type=:top_elite)");
    Session ssn = getSession();
    Query q = ssn.createQuery(hql.toString());
    q.setInteger("status", TopicBean.STATUS_NORMAL);
    q.setInteger("elite", TopicBean.INFO_TYPE_ELITE);
    q.setInteger("top_elite", TopicBean.INFO_TYPE_TOP_ELITE);
    if(site!=null)
      q.setInteger("site", site.getId());
View Full Code Here

Examples of org.hibernate.Session.createQuery()

      hql.append(" AND t.site.id=:site");
    if(fbean!=null)
      hql.append(" AND t.forum.id=:forum");
    hql.append(" AND (t.type=:elite OR t.type=:top_elite) ORDER BY ROUND(t.type / 16, 0) DESC, t.id DESC");
    Session ssn = getSession();
    Query q = ssn.createQuery(hql.toString());
    q.setInteger("status", TopicBean.STATUS_NORMAL);
    q.setInteger("elite", TopicBean.INFO_TYPE_ELITE);
    q.setInteger("top_elite", TopicBean.INFO_TYPE_TOP_ELITE);
    if(site!=null)
      q.setInteger("site", site.getId());
View Full Code Here

Examples of org.hibernate.Session.createQuery()

    if(forum != null)
      hql.append(" AND t.forum.id=?");
    hql.append(" ORDER BY ROUND(t.type / 16, 0) DESC, t.replyCount DESC, t.id DESC");
    Session ssn = getSession();
    try{
      Query q = ssn.createQuery(hql.toString());
      q.setInteger(0, site.getId());
      q.setInteger(1, TopicOutlineBean.STATUS_NORMAL);
      Calendar cur_time = Calendar.getInstance();
      cur_time.add(Calendar.DATE, -days);
      q.setTimestamp(2, new Timestamp(cur_time.getTime().getTime()));
View Full Code Here

Examples of org.hibernate.Session.createQuery()

    }
    hql.append(')');
    try{
      Session ssn = getSession();
      beginTransaction();
      Query q = ssn.createQuery(hql.toString());
      q.setInteger(0, incCount);
      for(int i=1;i<=music_ids.length;i++){
        q.setParameter(i, new Integer(music_ids[i-1]));
      }
      int er = q.executeUpdate();
View Full Code Here

Examples of org.hibernate.Session.createQuery()

    int i=0;
    for(;i<ids.size();i++){
      hql.append("?,");
    }
    hql.append("?) ORDER BY m.id DESC");     
    Query q = ssn.createQuery(hql.toString());
    for(i=0;i<ids.size();i++){
      int id = ((Number)ids.get(i)).intValue();
      q.setInteger(i, id);
    }
    q.setInteger(i, -1);
View Full Code Here

Examples of org.hibernate.Session.createQuery()

      hql.append(" AND p.album.id=:album");
    }
    hql.append(" ORDER BY p.id DESC");
    Session ssn = getSession();
    try{
      Query q = ssn.createQuery(hql.toString());
      q.setInteger("photo_status", PhotoBean.STATUS_NORMAL);
      q.setInteger("site", site.getId());
      q.setInteger("photo", photo_id);
      if(album_id > 0)
        q.setInteger("album", album_id);
View Full Code Here

Examples of org.hibernate.Session.createQuery()

      hql.append(" AND p.album.id=:album");
    }
    hql.append(" ORDER BY p.id ASC");
    Session ssn = getSession();
    try{
      Query q = ssn.createQuery(hql.toString());
      q.setInteger("photo_status", PhotoBean.STATUS_NORMAL);
      q.setInteger("site", site.getId());
      q.setInteger("photo", photo_id);
      if(album_id > 0)
        q.setInteger("album", album_id);
View Full Code Here

Examples of org.hibernate.Session.createQuery()

      hql.append(" AND p.date=:date");
    }
    hql.append(" ORDER BY p.id DESC");
    Session ssn = getSession();
    try{
      Query q = ssn.createQuery(hql.toString());
      q.setInteger("site", site.getId());
      if(album_id > 0)
        q.setInteger("album", album_id);
      if(month_stamp > 190000 && month_stamp < 209912){
        q.setInteger("year", month_stamp / 100);
View Full Code Here

Examples of org.hibernate.Session.createQuery()

      hql.append(" AND p.date=:date");
    }
    hql.append(" AND p.site.status=:site_status ORDER BY p.id DESC");
    Session ssn = getSession();
    try{
      Query q = ssn.createQuery(hql.toString());
      if(album_id > 0)
        q.setInteger("album", album_id);
      if(month_stamp > 190000 && month_stamp < 209912){
        q.setInteger("year", month_stamp / 100);
        q.setInteger("month", month_stamp % 100);
View Full Code Here
TOP
Copyright © 2015 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.