Package org.hibernate

Examples of org.hibernate.Criteria.createAlias()


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

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

                criteria.createAlias("taskInstance", "taskInstance");
                criteria.add(Expression.eq("taskInstance.taskId", taskid));
                return (List<IWorkItem>) criteria.list();
            }
        });
        return result;
View Full Code Here


                    criteria.add(cri_and);
                } else {
                    criteria.add(cri_or);
                }

                criteria.createAlias("taskInstance", "taskInstance");
                if (processInstanceId != null && !processInstanceId.trim().equals("")) {
                    criteria.add(Expression.eq("taskInstance.processInstanceId", processInstanceId));
                }

                return (List<IWorkItem>)criteria.list();
View Full Code Here

                    criteria.add(cri_and);
                } else {
                    criteria.add(cri_or);
                }

                criteria.createAlias("taskInstance", "taskInstance");
                if (processId != null && !processId.trim().equals("")) {
                    criteria.add(Expression.eq("taskInstance.processId", processId));
                }

                if (taskId != null && !taskId.trim().equals("")) {
View Full Code Here

                    criteria.add(cri_and);
                } else {
                    criteria.add(cri_or);
                }

                criteria.createAlias("taskInstance", "taskInstance");
                if (processInstanceId != null && !processInstanceId.trim().equals("")) {
                    criteria.add(Expression.eq("taskInstance.processInstanceId", processInstanceId));
                }

                return (List<IWorkItem>)criteria.list();
View Full Code Here

                    criteria.add(cri_and);
                } else {
                    criteria.add(cri_or);
                }

                criteria.createAlias("taskInstance", "taskInstance");
                if (processId != null && !processId.trim().equals("")) {
                    criteria.add(Expression.eq("taskInstance.processId", processId));
                }

                if (taskId != null && !taskId.trim().equals("")) {
View Full Code Here

      assertEquals( "LineItem by pk prop (named composite identifier)", 1, count );
    }

    crit = s.createCriteria( Order.class );
    crit.setProjection( Projections.rowCount() );
    crit.createAlias( "orderee", "p" ).add( Restrictions.eq( "p.id", new Integer(1) ) );
    count = extractCount( crit );
    assertEquals( 0, count );

    crit = s.createCriteria( Order.class );
    crit.setProjection( Projections.rowCount() );
View Full Code Here

    count = extractCount( crit );
    assertEquals( 0, count );

    crit = s.createCriteria( Order.class );
    crit.setProjection( Projections.rowCount() );
    crit.createAlias( "orderee", "p" ).add( Restrictions.eq( "p.pk", new Long(1) ) );
    count = extractCount( crit );
    assertEquals( 1, count );

    crit = s.createCriteria( Order.class );
    crit.setProjection( Projections.rowCount() );
View Full Code Here

    count = extractCount( crit );
    assertEquals( 1, count );

    crit = s.createCriteria( Order.class );
    crit.setProjection( Projections.rowCount() );
    crit.createAlias( "orderee", "p" ).add( Restrictions.eq( "p.id", new Integer(123) ) );
    count = extractCount( crit );
    assertEquals( 1, count );

    crit = s.createCriteria( LineItem.class );
    crit.setProjection( Projections.rowCount() );
View Full Code Here

            throw new RollerException("entryid is null");
       
        try {
            Session session = ((HibernatePersistenceStrategy)strategy).getSession();
            Criteria criteria = session.createCriteria(RefererData.class);
            criteria.createAlias("weblogEntry","e");
           
            criteria.add(Expression.eq("e.id", entryid));
            criteria.add(Expression.isNotNull("title"));
            criteria.add(Expression.isNotNull("excerpt"));
           
View Full Code Here

            Criteria criteria = session.createCriteria(CommentData.class);
           
            if (entry != null) {
                criteria.add(Expression.eq("weblogEntry", entry));
            } else if (website != null) {
                criteria.createAlias("weblogEntry","e");
                criteria.add(Expression.eq("e.website", website));
            }
           
            if (searchString != null) {
                criteria.add(Expression.disjunction()
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.