Package org.hibernate

Examples of org.hibernate.Criteria.createCriteria()


         query.add( processInstanceEnded ? isNotNull("end") : isNull("end") );
      }
     
      if (processDefinitionName!=null)
      {
         query.createCriteria("processDefinition")
               .add( Restrictions.eq("name", processDefinitionName) );
      }
     
      query = query.createCriteria("rootToken");
      if (sortDescending!=null)
View Full Code Here


        final String... propertyNames)
    {
        Criteria crit = baseCriteria;
        for (String property : propertyNames)
        {
            crit = crit.createCriteria(property);
        }
        return crit;
    }

    protected Number count()
View Full Code Here

        }

        if (connected)
        {
            // Sessions no longer expire. Return all users with an existing session
            criteria.createCriteria("sessions").add(Restrictions.isNotNull("id"));
            // criteria.createCriteria("sessions").add(Restrictions.gt("expireDate", new Date()));
            criteria.setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY);
        }
        return criteria;
    }
View Full Code Here

        criteria.setProjection(Projections.rowCount());
        int itemCount = (Integer) criteria.list().get(0);
        // even when no item has this field not null currently, items may have history with this field not null
        // because of the "parent" difference, cannot use AbstractItem and have to do a separate Criteria query
        criteria = getSession().createCriteria(History.class);
        criteria.createCriteria("parent").add(Restrictions.eq("space", space));
        criteria.add(Restrictions.isNotNull(field.getName().toString()));
        criteria.setProjection(Projections.rowCount());
        return itemCount + (Integer) criteria.list().get(0);
    }
   
View Full Code Here

        criteria.setProjection(Projections.rowCount());
        int itemCount = (Integer) criteria.list().get(0);
        // even when no item has this field value currently, items may have history with this field value
        // because of the "parent" difference, cannot use AbstractItem and have to do a separate Criteria query
        criteria = getSession().createCriteria(History.class);
        criteria.createCriteria("parent").add(Restrictions.eq("space", space));
        criteria.add(Restrictions.eq(field.getName().toString(), optionKey));
        criteria.setProjection(Projections.rowCount());
        return itemCount + (Integer) criteria.list().get(0);
    }
   
View Full Code Here

        criteria.setProjection(Projections.rowCount());
        int itemCount = (Integer) criteria.list().get(0);
        // even when no item has this status currently, items may have history with this status
        // because of the "parent" difference, cannot use AbstractItem and have to do a separate Criteria query
        criteria = getSession().createCriteria(History.class);
        criteria.createCriteria("parent").add(Restrictions.eq("space", space));
        criteria.add(Restrictions.eq("status", status));
        criteria.setProjection(Projections.rowCount());
        return itemCount + (Integer) criteria.list().get(0);
    }
   
View Full Code Here

    Criteria criteria = session.createCriteria(Book.class);
   
    // programmatically add genre criteria to our criteria obj
   

    criteria.createCriteria("genres").add(Restrictions.eq("genre", genre));
   
    // criteria.add(Restrictions.eq("genre",genre));
   
    books = (List<Book>)criteria.list(); // get the list
   
View Full Code Here

    Criteria criteria = session.createCriteria(Book.class);
   
    // programmatically add genre criteria to our criteria obj
   

    criteria.createCriteria("genres").add(Restrictions.eq("genre", genre));
   
    // criteria.add(Restrictions.eq("genre",genre));
   
    books = (List<Book>)criteria.list(); // get the list
   
View Full Code Here

    Criteria criteria = session.createCriteria(Book.class);
   
    // programmatically add genre criteria to our criteria obj
   

    criteria.createCriteria("genres").add(Restrictions.eq("genre", genre));
   
    // criteria.add(Restrictions.eq("genre",genre));
   
    books = (List<Book>)criteria.list(); // get the list
   
View Full Code Here

    List childrenNodes = new ArrayList();

    Criteria critt = session.createCriteria(SbiKpiModelInst.class);
    critt.add(Expression.eq("sbiKpiModelInst", value));
    critt.createCriteria("sbiKpiModel").addOrder(Order.asc("kpiModelCd"));

    List children = critt.list();

    for (Iterator iterator = children.iterator(); iterator.hasNext();) {
      SbiKpiModelInst sbiKpichild = (SbiKpiModelInst) iterator.next();
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.