Package org.ofbiz.entity.condition

Examples of org.ofbiz.entity.condition.EntityExpr


    List entityExpressions, List orderBy, UserInfo userInfo,
    SecurityLinkInfo securityInfo, GenericDelegator delegator, String securityType)
    throws GenericEntityException
  {
    QueryInfo queryInfo = new QueryInfo( delegator, entity);
    EntityExpr entityExpr = null;

    //convert existing expressions into LIKE clauses.
    for (int i = 0; i < entityExpressions.size(); i++) {
      entityExpr = (EntityExpr) entityExpressions.get(i);

      Object lhs = entityExpr.getLhs();
      Object rhs = entityExpr.getRhs();
      EntityComparisonOperator op = (EntityComparisonOperator) entityExpr.getOperator();
      if ( !op.equals(EntityOperator.LIKE) && !op.equals(EntityOperator.EQUALS))
        throw new IllegalArgumentException("Join Operator must be LIKE or EQUALS");

      if (lhs instanceof EntityAttribute &&
          rhs instanceof EntityAttribute) {
View Full Code Here


      queryInfo.addJoin( "EntityAccess", "Role", Boolean.FALSE, "partyId", "roleId");

      queryInfo.checkAttribute("EntityAccess", "entityCreatedBy");
      queryInfo.checkAttribute("Role", "rolePath");
      EntityCondition condition  = new EntityConditionList( UtilMisc.toList(
        new EntityExpr( "entityCreatedBy", EntityOperator.EQUALS, userInfo.getPartyId() ),
        new EntityExpr( "rolePath", EntityOperator.LIKE, roleId)), EntityOperator.OR);
       
      queryInfo.addCondition( condition );

        } else if (roleOrTeam.equalsIgnoreCase("TEAM")) {
            // Find Entities in the Entity_Access table where the partyId has Team_Member access.
View Full Code Here

        EntityCondition condition = null;

        String accountId = (String) filterValues.get("accountId");

        if ((accountId != null)) {
          condition = new EntityExpr( "accountId", EntityOperator.EQUALS, accountId);
        }

        try {
            return SecurityWrapper.findByCondition("Contact", condition,
                orderBy, userInfo,
View Full Code Here

    dve.addViewLink("Product", "ProductAttribute", Boolean.FALSE, UtilMisc.toList(new ModelKeyMap("productId", "productId")));
    dve.addAlias("ProductAttribute", "attrName", null, null, null, null, null);
    dve.addAlias("ProductAttribute", "attrValue", null, null, null, null, null);
    
    EntityCondition condition = new EntityConditionList(UtilMisc.toList(
        new EntityExpr("attrName", EntityOperator.EQUALS, "OWNER"),
        new EntityExpr("attrValue", EntityOperator.EQUALS, userInfo.getAccountId())),
        EntityOperator.AND);
       
    return EntityHelper.findByCondition( delegator, dve, condition, null );
    }
View Full Code Here

    dve.addViewLink("ProductCategory", "ProductCategoryAttribute", Boolean.FALSE, UtilMisc.toList(new ModelKeyMap("productCategoryId", "productCategoryId")));
    dve.addAlias("ProductCategoryAttribute", "attrName", null, null, null, null, null);
    dve.addAlias("ProductCategoryAttribute", "attrValue", null, null, null, null, null);
    
    EntityCondition condition = new EntityConditionList(UtilMisc.toList(
        new EntityExpr("attrName", EntityOperator.EQUALS, "OWNER"),
        new EntityExpr("attrValue", EntityOperator.EQUALS, userInfo.getAccountId())),
        EntityOperator.AND);
       
        return EntityHelper.findByCondition( delegator, dve, condition, null );
    }
View Full Code Here

    dve.addViewLink("UiScreenSection", "UiScreen", Boolean.FALSE, UtilMisc.toList(new ModelKeyMap("screenId", "screenId")));
    dve.addAlias("UiScreen", "screenName", null, null, null, null, null);
    dve.addAlias("UiScreenSection", "sectionName", null, null, null, null, null);
    
    EntityCondition condition = new EntityConditionList(UtilMisc.toList(
        new EntityExpr("partyId", EntityOperator.EQUALS, "-1"),
        new EntityExpr("screenName", EntityOperator.EQUALS, screenName),
        new EntityExpr("sectionName", EntityOperator.EQUALS, sectionName)),
        EntityOperator.AND);
       
      uiQueryGVL.addAll(EntityHelper.findByCondition( delegator, dve, condition, uiQueryFindOrder ));

        // Add all queries tied to the current party ID and screen section.
    // select X from ui_query q, ui_screen_section ss, ui_screen s where q.section_id = ss.section_id and q.party_id = <partyId> and ss.section_name = <section_name>
    //      and s.screen_name = <screenName> and s.screen_id = ss.screen_id order by query_name      
    condition = new EntityConditionList(UtilMisc.toList(
        new EntityExpr("partyId", EntityOperator.EQUALS, partyId),
        new EntityExpr("screenName", EntityOperator.EQUALS, screenName),
        new EntityExpr("sectionName", EntityOperator.EQUALS, sectionName)),
        EntityOperator.AND);
       
    uiQueryGVL.addAll(EntityHelper.findByCondition( delegator, dve, condition, uiQueryFindOrder ));

        return uiQueryGVL;
View Full Code Here

    dve.addViewLink("UiScreenSection", "UiScreen",Boolean.FALSE, UtilMisc.toList(new ModelKeyMap("screenId", "screenId")));
    dve.addAlias("UiScreen", "screenName", null, null, null, null, null);
    dve.addAlias("UiScreenSection", "sectionName", null, null, null, null, null);
    
    EntityCondition condition = new EntityConditionList(UtilMisc.toList(
        new EntityExpr("partyId", EntityOperator.EQUALS, partyId),
           new EntityExpr("queryName", EntityOperator.EQUALS, savedQueryName),
        new EntityExpr("screenName", EntityOperator.EQUALS, screenName),
        new EntityExpr("sectionName", EntityOperator.EQUALS, sectionName)),
        EntityOperator.AND);
       
    List uiQueryGVL = EntityHelper.findByCondition( delegator, dve, condition, null );
       
        if (uiQueryGVL.size() == 0) {
View Full Code Here

     
      if ( isOuterJoin )
      {
        queryInfo.addAlias("Address", "isPrimary", "isPrimary");
        queryInfo.addAlias("Address", "addressId", "addressId");
        queryInfo.addCondition( new EntityConditionList( UtilMisc.toList( new EntityExpr("isPrimary", EntityOperator.EQUALS, "Y"),
                      new EntityExpr("addressId", EntityOperator.EQUALS, null)), EntityOperator.OR));
      }
      else
        queryInfo.addCondition("Address", "isPrimary", EntityOperator.EQUALS, "Y");

        } else {
View Full Code Here

     
      if ( isOuterJoin )
      {
        queryInfo.addAlias("Address", "isPrimary", "isPrimary");
        queryInfo.addAlias("Address", "addressId", "addressId");
        queryInfo.addCondition( new EntityConditionList( UtilMisc.toList( new EntityExpr("isPrimary", EntityOperator.EQUALS, "Y"),
                      new EntityExpr("addressId", EntityOperator.EQUALS, null)), EntityOperator.OR));
      }
      else
        queryInfo.addCondition("Address", "isPrimary", EntityOperator.EQUALS, "Y");
        } else {
            // Use the parent script for all other related entities.
View Full Code Here

        orderBy.add("firstName");

    EntityCondition condition = null;
        if ((accountId != null) && (accountId.length() > 0) &&
                (!accountId.equals("null"))) {
      condition = new EntityExpr("accountId", EntityOperator.EQUALS, accountId);

            Debug.logVerbose(
                    "-->[ActivityContactAvailableSelect.getDropDownValues] Adding entity clause for account ID: " +
                    accountId, module);
        }
View Full Code Here

TOP

Related Classes of org.ofbiz.entity.condition.EntityExpr

Copyright © 2018 www.massapicom. 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.