Examples of createAlias()


Examples of org.hibernate.Criteria.createAlias()

    Session s = openSession();
    s.getTransaction().begin();

    Criteria rootCriteria = s.createCriteria( Order.class );
    // create alias, ensuring we stay on the root criteria
    assertSame( rootCriteria, rootCriteria.createAlias( "orderLines", "ol", JoinFragment.LEFT_OUTER_JOIN ) );

    // add restrictions to rootCriteria
    assertSame(
        rootCriteria,
        rootCriteria.add(
View Full Code Here

Examples of org.hibernate.Criteria.createAlias()

  public List<IWorkItem> findWorkItemsForTaskInstance(final String taskInstanceId){
        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.id", taskInstanceId));
               
              return (List<IWorkItem>) criteria.list();
            }
        });
View Full Code Here

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

Examples of org.hibernate.Criteria.createAlias()

                    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

Examples of org.hibernate.Criteria.createAlias()

                    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

Examples of org.hibernate.Criteria.createAlias()

                    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

Examples of org.hibernate.Criteria.createAlias()

                    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

Examples of org.hibernate.Criteria.createAlias()

      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

Examples of org.hibernate.Criteria.createAlias()

    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

Examples of org.hibernate.Criteria.createAlias()

    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
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.