Examples of createAlias()


Examples of org.hibernate.Criteria.createAlias()

    public List<Account> findEmployeesByCriteria(UserSearchCriteria searchCriteria) {
        final Session session = (Session) entityManager.getDelegate();
        final Criteria criteria = session.createCriteria(Account.class);

        criteria.setFetchMode("employee", FetchMode.JOIN);
        criteria.createAlias("employee", "Employee");
        if (searchCriteria.isIsFirstNameSet()) {
            criteria.add(Restrictions.like("Employee.firstName", "%" + searchCriteria.getFirstName() + "%"));
        }
        if (searchCriteria.isIsLastNameSet()) {
            criteria.add(Restrictions.like("Employee.lastName", "%" + searchCriteria.getLastName() + "%"));
View Full Code Here

Examples of org.hibernate.Criteria.createAlias()

        if (searchCriteria.isIsParentNameSet()) {
            criteria.add(Restrictions.like("Employee.parentName", "%" + searchCriteria.getParentName() + "%"));
        }
        if (searchCriteria.isIsOfficeSet()) {
            criteria.setFetchMode("Employee.office", FetchMode.JOIN);
            criteria.createAlias("Employee.office", "Offic");
            criteria.add(Restrictions.like("Offic.title", "%" + searchCriteria.getOffice() + "%"));
        }

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

Examples of org.hibernate.Criteria.createAlias()

                        or(
                            and(eq("inventoryPolicyState", BlankState.EMPTY), le("inventoryDate", dateTo)),
                            and(eq("inventoryPolicyState", BlankState.WRITE_OFF), le("writeOffDate", dateTo))
                            )));
        }
        criteria.createAlias("realId.series", "serie");
        criteria.addOrder(Order.asc("serie.series"));
        criteria.addOrder(Order.asc("realId.number"));
        return (List<BlankPolicy>) criteria.list();
    }
}
View Full Code Here

Examples of org.hibernate.Criteria.createAlias()

   
    return new CommandEvaluator<List, Session>() {
      public List evaluate(Session session) {
        Criteria criteria = session.createCriteria(HProcessInstance.class).createAlias("process", "process");
        if(joinCorrelationSet) {
            criteria = criteria.createAlias("correlationSets", "property");
        }
        if(selectionEvaluator!=null) {
          criteria.add(selectionEvaluator.evaluate(null));
        }
        if (orderEvaluator != null) {
View Full Code Here

Examples of org.hibernate.Criteria.createAlias()

    System.out.println("logic");
    SessionFactory s1=new Configuration().configure("/hibernate.cfg.xml").buildSessionFactory();
    Session session=s1.openSession();
    //select os.osname id.name from machine id, osvo so
    Criteria criteria = session.createCriteria(osvo.class, "os");
    criteria.createAlias("os.machineid", "id", Criteria.INNER_JOIN);
   
    ProjectionList p=Projections.projectionList();
   
    p.add(Projections.property("id.name"));
    p.add(Projections.property("osname"));
View Full Code Here

Examples of org.hibernate.Criteria.createAlias()

    public List<Tax> findTaxesByMarketAreaId(Long marketAreaId, Object... params) {
        Criteria criteria = createDefaultCriteria(Tax.class);

        handleSpecificFetchMode(criteria, params);

        criteria.createAlias("marketAreas", "marketArea", JoinType.LEFT_OUTER_JOIN);
        criteria.add(Restrictions.eq("marketArea.id", marketAreaId));

        criteria.addOrder(Order.asc("code"));

        @SuppressWarnings("unchecked")
View Full Code Here

Examples of org.hibernate.Criteria.createAlias()

    public List<Warehouse> findWarehousesByMarketAreaId(Long marketAreaId, Object... params) {
        Criteria criteria = createDefaultCriteria(Warehouse.class);

        handleSpecificFetchMode(criteria, params);

        criteria.createAlias("warehouseMarketAreaRels", "warehouseMarketAreaRel", JoinType.LEFT_OUTER_JOIN);
        criteria.add(Restrictions.eq("warehouseMarketAreaRel.pk.marketArea.id", marketAreaId));

        criteria.addOrder(Order.asc("code"));

        @SuppressWarnings("unchecked")
View Full Code Here

Examples of org.hibernate.Criteria.createAlias()

    public List<Warehouse> findWarehousesByDeliveryMethodId(Long deliveryMethodId, Object... params) {
        Criteria criteria = createDefaultCriteria(Warehouse.class);

        handleSpecificFetchMode(criteria, params);

        criteria.createAlias("deliveryMethods", "deliveryMethod", JoinType.LEFT_OUTER_JOIN);
        criteria.add(Restrictions.eq("deliveryMethod.id", deliveryMethodId));

        criteria.addOrder(Order.asc("code"));

        @SuppressWarnings("unchecked")
View Full Code Here

Examples of org.hibernate.Criteria.createAlias()

    public List<ProductMarketing> findProductMarketingsByBrandId(final Long brandId, Object... params) {
        Criteria criteria = createDefaultCriteria(ProductMarketing.class);
        handleSpecificProductMarketingFetchMode(criteria, params);

        criteria.setFetchMode("productBrand", FetchMode.JOIN);
        criteria.createAlias("productBrand", "productBrand", JoinType.LEFT_OUTER_JOIN);
       
        criteria.add(Restrictions.eq("productBrand.id", brandId));
        criteria.addOrder(Order.asc("id"));

        @SuppressWarnings("unchecked")
View Full Code Here

Examples of org.hibernate.Criteria.createAlias()

  public List<ProductMarketing> findProductMarketingsByBrandCode(final String brandCode, Object... params) {
        Criteria criteria = createDefaultCriteria(ProductMarketing.class);
        handleSpecificProductMarketingFetchMode(criteria, params);

        criteria.setFetchMode("productBrand", FetchMode.JOIN);
        criteria.createAlias("productBrand", "productBrand", JoinType.LEFT_OUTER_JOIN);
       
        criteria.add(Restrictions.eq("productBrand.code", handleCodeValue(brandCode)));
        criteria.addOrder(Order.asc("id"));

        @SuppressWarnings("unchecked")
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.