Package org.hibernate

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


   
    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

    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

    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

    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

    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

    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

  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

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

        criteria.createAlias("productSkus", "productSku", JoinType.LEFT_OUTER_JOIN);
        criteria.createAlias("productSku.catalogCategoryMasterProductSkuRels", "catalogCategoryProductSkuRel", JoinType.LEFT_OUTER_JOIN);
        criteria.add(Restrictions.eq("catalogCategoryProductSkuRel.pk.catalogCategoryMaster.id", categoryId));

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

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

        criteria.createAlias("productSkus", "productSku", JoinType.LEFT_OUTER_JOIN);
        criteria.createAlias("productSku.catalogCategoryMasterProductSkuRels", "catalogCategoryProductSkuRel", JoinType.LEFT_OUTER_JOIN);
        criteria.add(Restrictions.eq("catalogCategoryProductSkuRel.pk.catalogCategoryMaster.id", categoryId));

        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.