Package org.hibernate.criterion

Examples of org.hibernate.criterion.Criterion


                Criteria criteria = arg0.createCriteria(TaskInstance.class);
                criteria.add(Expression.eq("taskId", taskId.trim()));
                criteria.add(Expression.eq("processInstanceId", processInstanceId));

                Criterion cri2 = Expression.eq("state", new Integer(ITaskInstance.COMPLETED));

                criteria.add(cri2);

                ProjectionList prolist = Projections.projectionList();
                prolist.add(Projections.rowCount());
View Full Code Here


                Criteria criteria = arg0.createCriteria(TaskInstance.class);
                criteria.add(Expression.eq("processInstanceId", processInstanceId.trim()));

                criteria.add(Expression.eq("activityId", activityId.trim()));

                Criterion cri1 = Expression.eq("state", new Integer(ITaskInstance.INITIALIZED));
                Criterion cri2 = Expression.eq("state", new Integer(ITaskInstance.RUNNING));
                Criterion cri_or = Expression.or(cri1, cri2);

                criteria.add(cri_or);

                ProjectionList prolist = Projections.projectionList();
                prolist.add(Projections.rowCount());
View Full Code Here

            public Object doInHibernate(Session arg0) throws HibernateException, SQLException {
                Criteria criteria = arg0.createCriteria(TaskInstance.class);


                Criterion cri1 = Expression.eq("state", new Integer(ITaskInstance.INITIALIZED));
                Criterion cri2 = Expression.eq("state", new Integer(ITaskInstance.RUNNING));
                Criterion cri_or = Expression.or(cri1, cri2);

                Criterion cri0 = Expression.eq("id", id);
                Criterion cri_and = Expression.and(cri0, cri_or);
                criteria.add(cri_and);

                return criteria.uniqueResult();
            }
        });
View Full Code Here

            public Object doInHibernate(Session arg0) throws HibernateException, SQLException {
                Criteria criteria = arg0.createCriteria(ProcessInstance.class);


                Criterion cri1 = Expression.eq("state", new Integer(IProcessInstance.INITIALIZED));
                Criterion cri2 = Expression.eq("state", new Integer(IProcessInstance.RUNNING));

                Criterion cri_or = Expression.or(cri1, cri2);
               

                Criterion cri0 = Expression.eq("id", id);
                Criterion cri_and = Expression.and(cri0, cri_or);
                criteria.add(cri_and);

                return criteria.uniqueResult();
            }
        });
View Full Code Here

        List<IWorkItem> result = (List<IWorkItem>) this.getHibernateTemplate().execute(new HibernateCallback() {

            public Object doInHibernate(Session arg0) throws HibernateException, SQLException {
                Criteria criteria = arg0.createCriteria(WorkItem.class);

                Criterion cri1 = Expression.eq("state", new Integer(IWorkItem.INITIALIZED));
                Criterion cri2 = Expression.eq("state", new Integer(IWorkItem.RUNNING));
                Criterion cri_or = Expression.or(cri1, cri2);

                if (actorId != null && !actorId.trim().equals("")) {
                    Criterion cri0 = Expression.eq("actorId", actorId);
                    Criterion cri_and = Expression.and(cri0, cri_or);
                    criteria.add(cri_and);
                } else {
                    criteria.add(cri_or);
                }
View Full Code Here

        List<IWorkItem> result = (List<IWorkItem>) this.getHibernateTemplate().execute(new HibernateCallback() {

            public Object doInHibernate(Session arg0) throws HibernateException, SQLException {
                Criteria criteria = arg0.createCriteria(WorkItem.class);

                Criterion cri1 = Expression.eq("state", new Integer(IWorkItem.INITIALIZED));
                Criterion cri2 = Expression.eq("state", new Integer(IWorkItem.RUNNING));
                Criterion cri_or = Expression.or(cri1, cri2);

                if (actorId != null && !actorId.trim().equals("")) {
                    Criterion cri0 = Expression.eq("actorId", actorId);
                    Criterion cri_and = Expression.and(cri0, cri_or);
                    criteria.add(cri_and);
                } else {
                    criteria.add(cri_or);
                }
View Full Code Here

        List<IWorkItem> result = (List<IWorkItem>) this.getHibernateTemplate().execute(new HibernateCallback() {

            public Object doInHibernate(Session arg0) throws HibernateException, SQLException {
                Criteria criteria = arg0.createCriteria(WorkItem.class);

                Criterion cri1 = Expression.eq("state", new Integer(IWorkItem.COMPLETED));
                Criterion cri2 = Expression.eq("state", new Integer(IWorkItem.CANCELED));
                Criterion cri_or = Expression.or(cri1, cri2);

                if (actorId != null && !actorId.trim().equals("")) {
                    Criterion cri0 = Expression.eq("actorId", actorId);
                    Criterion cri_and = Expression.and(cri0, cri_or);
                    criteria.add(cri_and);
                } else {
                    criteria.add(cri_or);
                }
View Full Code Here

            public Object doInHibernate(Session arg0) throws HibernateException, SQLException {
                Criteria criteria = arg0.createCriteria(WorkItem.class);


                Criterion cri1 = Expression.eq("state", new Integer(IWorkItem.COMPLETED));
                Criterion cri2 = Expression.eq("state", new Integer(IWorkItem.CANCELED));
                Criterion cri_or = Expression.or(cri1, cri2);

                if (actorId != null && !actorId.trim().equals("")) {
                    Criterion cri0 = Expression.eq("actorId", actorId);
                    Criterion cri_and = Expression.and(cri0, cri_or);
                    criteria.add(cri_and);
                } else {
                    criteria.add(cri_or);
                }
View Full Code Here

            public Object doInHibernate(Session arg0) throws HibernateException, SQLException {
                Criteria criteria = arg0.createCriteria(ProcessInstance.class);
                criteria.add(Expression.eq("parentTaskInstanceId", taskInstanceId));

                Criterion cri1 = Expression.eq("state", new Integer(IProcessInstance.INITIALIZED));
                Criterion cri2 = Expression.eq("state", new Integer(IProcessInstance.RUNNING));
//              Criterion cri3 = Expression.eq("state", new Integer(IProcessInstance.SUSPENDED));
                Criterion cri_or = Expression.or(cri1, cri2);
//              Criterion cri_or = Expression.or(cri_tmp, cri3);

                criteria.add(cri_or);

                ProjectionList prolist = Projections.projectionList();
View Full Code Here

           
            Criteria crit = session.createCriteria(clazz);
            if(criterions != null) {
                Iterator it = criterions.iterator();
                while(it.hasNext()){
                    Criterion criterion
                            = (Criterion)it.next();
                    crit.add(criterion);
                }
            }
           
View Full Code Here

TOP

Related Classes of org.hibernate.criterion.Criterion

Copyright © 2018 www.massapicom. 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.