Package org.hibernate

Examples of org.hibernate.Criteria.createAlias()


        FetchPlan fetchPlan = handleSpecificFetchVirtualCategoryMode(criteria, params);

        criteria.createAlias("catalog", "catalog", JoinType.LEFT_OUTER_JOIN);
        criteria.add(Restrictions.eq("catalog.code", handleCodeValue(catalogVirtualCode)));

        criteria.createAlias("categoryMaster", "categoryMaster", JoinType.LEFT_OUTER_JOIN);
        criteria.add(Restrictions.eq("categoryMaster.code", handleCodeValue(catalogCategoryCode)));

        criteria.createAlias("categoryMaster.catalog", "catalogMaster", JoinType.LEFT_OUTER_JOIN);
        criteria.add(Restrictions.eq("catalogMaster.code", handleCodeValue(catalogMasterCode)));
       
View Full Code Here


        criteria.add(Restrictions.eq("catalog.code", handleCodeValue(catalogVirtualCode)));

        criteria.createAlias("categoryMaster", "categoryMaster", JoinType.LEFT_OUTER_JOIN);
        criteria.add(Restrictions.eq("categoryMaster.code", handleCodeValue(catalogCategoryCode)));

        criteria.createAlias("categoryMaster.catalog", "catalogMaster", JoinType.LEFT_OUTER_JOIN);
        criteria.add(Restrictions.eq("catalogMaster.code", handleCodeValue(catalogMasterCode)));
       
        CatalogCategoryVirtual catalogCategory = (CatalogCategoryVirtual) criteria.uniqueResult();
        if(catalogCategory != null){
            catalogCategory.setFetchPlan(fetchPlan);
View Full Code Here

  public List<CatalogCategoryVirtual> findRootVirtualCatalogCategoriesByCatalogCode(final String catalogVirtualCode, Object... params) {
        Criteria criteria = createDefaultCriteria(CatalogCategoryVirtual.class);

        handleSpecificFetchVirtualCategoryMode(criteria, params);
       
        criteria.createAlias("catalog", "catalog", JoinType.LEFT_OUTER_JOIN);
        criteria.add(Restrictions.eq("catalog.code", handleCodeValue(catalogVirtualCode)));
        criteria.add(Restrictions.isNull("parentCatalogCategory"));
       
        criteria.addOrder(Order.asc("id"));
View Full Code Here

    public List<CatalogCategoryVirtual> findAllVirtualCatalogCategoriesByCatalogCode(final String catalogVirtualCode, Object... params) {
        Criteria criteria = createDefaultCriteria(CatalogCategoryVirtual.class);

        handleSpecificFetchVirtualCategoryMode(criteria, params);
       
        criteria.createAlias("catalog", "catalog", JoinType.LEFT_OUTER_JOIN);
        criteria.add(Restrictions.eq("catalog.code", handleCodeValue(catalogVirtualCode)));
       
        criteria.addOrder(Order.asc("id"));

        @SuppressWarnings("unchecked")
View Full Code Here

  public List<CatalogCategoryVirtual> findVirtualCategoriesByProductSkuId(final Long productSkuId, Object... params) {
        Criteria criteria = createDefaultCriteria(CatalogCategoryVirtual.class);

        handleSpecificFetchVirtualCategoryMode(criteria, params);
       
        criteria.createAlias("catalogCategoryProductSkuRels", "catalogCategoryProductSkuRel", JoinType.LEFT_OUTER_JOIN);
        criteria.add(Restrictions.eq("catalogCategoryProductSkuRel.pk.productSku.id", productSkuId));

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

        @SuppressWarnings("unchecked")
View Full Code Here

        Criteria criteria = createDefaultCriteria(CatalogVirtual.class);
       
        FetchPlan fetchPlan = handleSpecificFetchMode(criteria, params);
       
        criteria.setFetchMode("catalogMaster", FetchMode.JOIN);
        criteria.createAlias("marketArea", "marketArea", JoinType.LEFT_OUTER_JOIN);
        criteria.add(Restrictions.eq("marketArea.id", marketAreaId));

        CatalogVirtual catalogVirtual = (CatalogVirtual) criteria.uniqueResult();
        if(catalogVirtual != null){
            catalogVirtual.setFetchPlan(fetchPlan);
View Full Code Here

    public List<DeliveryMethod> findDeliveryMethodsByWarehouseId(Long warehouseId, Object... params) {
        Criteria criteria = createDefaultCriteria(DeliveryMethod.class);

        handleSpecificFetchMode(criteria, params);

        criteria.createAlias("warehouses", "warehouse", JoinType.LEFT_OUTER_JOIN);
        criteria.add(Restrictions.eq("warehouse.id", warehouseId));

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

        @SuppressWarnings("unchecked")
View Full Code Here

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

        handleSpecificFetchMode(criteria, params);

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

        criteria.addOrder(Order.asc("id"));
View Full Code Here

        Criteria criteria = createDefaultCriteria(DeliveryMethod.class);

        handleSpecificFetchMode(criteria, params);

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

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

        @SuppressWarnings("unchecked")
View Full Code Here

  public List<Retailer> findRetailersByTags(final List<String> tags, Object... params) {
        Criteria criteria = createDefaultCriteria(Retailer.class);

        handleSpecificRetailerFetchMode(criteria, params);

        criteria.createAlias("retailerTags", "tag", JoinType.LEFT_OUTER_JOIN);
        criteria.add(Restrictions.in("tag.code", tags));
       
        criteria.addOrder(Order.asc("name"));

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