Package org.ofbiz.entity.condition

Examples of org.ofbiz.entity.condition.EntityExpr


    dve.addMemberEntity("ProductFeatureAppl", "ProductFeatureAppl");
    dve.addViewLink("ProductFeature", "ProductFeatureAppl", Boolean.FALSE, UtilMisc.toList(new ModelKeyMap("productFeatureId", "productFeatureId")));
    dve.addAlias("ProductFeatureAppl", "productId", null, null, null, null, null);
    
    EntityCondition condition = new EntityConditionList(UtilMisc.toList(
        new EntityExpr("productFeatureTypeId", EntityOperator.EQUALS, productFeatureTypeId),
        new EntityExpr("productId", EntityOperator.EQUALS, productId)),
        EntityOperator.AND);
       
      List pfCol = EntityHelper.findByCondition( delegator, dve, condition, null );
       
        GenericValue[] pfGvs = (GenericValue[]) pfCol.toArray(new GenericValue[0]);
View Full Code Here


        EntityCondition condition = null;

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

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

                //find contacts for role
                Vector contactFields = new Vector();
                Vector contactValueVector = new Vector();
                Vector contactOps = new Vector();

                contactFields.add(new EntityExpr("roleId",
                        EntityOperator.EQUALS, roleId));

                List contacts = delegator.findByAnd("Contact", contactFields,
                        null);
                GenericValue[] contactValues = (GenericValue[]) contacts.toArray(new GenericValue[0]);
View Full Code Here

  }

  public void addCondition( String entityAlias, String attributeAlias, String attributeName, EntityComparisonOperator operator, Object value )
  {
    checkAttribute( entityAlias, attributeName, attributeAlias);
    entityConditions.add( new EntityExpr( attributeAlias, operator, value));
  }
View Full Code Here

    dve.addAlias("EntityAccess", "partyEntityType", null, null, null, null, null);
    dve.addAlias("EntityAccess", "entity", null, null, null, null, null);
    dve.addAlias("TeamMember", "tmPartyId", "partyId", null, null, null, null);
    
    EntityCondition condition = new EntityConditionList(UtilMisc.toList(
        new EntityExpr("entity", EntityOperator.EQUALS, "Deal"),
             new EntityExpr("partyEntityType", EntityOperator.EQUALS, "Team"),
        new EntityExpr("tmPartyId", EntityOperator.EQUALS, partyId),
        new EntityExpr("projectedCloseDate", EntityOperator.LESS_THAN_EQUAL_TO, endDate),
        new EntityExpr("projectedCloseDate", EntityOperator.GREATER_THAN_EQUAL_TO, beginDate),
        new EntityExpr("isInForecast", EntityOperator.EQUALS, "1")
        ),
        EntityOperator.AND);
               
    return EntityHelper.findByCondition( delegator, dve, condition, UtilMisc.toList("projectedCloseDate") );
    }
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

    dve.addMemberEntity("Code", "Code");
    dve.addViewLink("RoleType", "Code", Boolean.FALSE, UtilMisc.toList(new ModelKeyMap("roleTypeId", "codeId")));
    dve.addAlias("Code", "codeTypeId", null, null, null, null, null);
    
    EntityCondition condition = new EntityConditionList(UtilMisc.toList(
        new EntityExpr("codeTypeId", EntityOperator.EQUALS, "ROLE_TYPE_SFA")),
        EntityOperator.AND);
       
        try {
            return EntityHelper.getPrimaryGVLFromDynamicGVL(delegator, EntityHelper.findByCondition( delegator, dve, condition, orderBy ), "RoleType");
        } catch (Exception e) {
View Full Code Here

    dve.addMemberEntity("UiEntity", "UiEntity");
    dve.addViewLink("UiAttribute", "UiEntity", Boolean.FALSE, UtilMisc.toList(new ModelKeyMap("entityId", "entityId")));
    dve.addAlias("UiEntity", "entityName", null, null, null, null, null);
    
    EntityCondition condition = new EntityConditionList(UtilMisc.toList(
        new EntityExpr("attributeName", EntityOperator.EQUALS, searchAttribName),
        new EntityExpr("entityName", EntityOperator.EQUALS, searchEntityName)),
        EntityOperator.AND);
       
        List queryGVL = EntityHelper.findByCondition( delegator, dve, condition, null );

        if (queryGVL.size() == 0) {
View Full Code Here

      dve.addMemberEntity("UiScreenSectionEntity", "UiScreenSectionEntity");
      dve.addViewLink("UiAttribute", "UiScreenSectionEntity", Boolean.FALSE, UtilMisc.toList(new ModelKeyMap("entityId", "entityId")));
      dve.addAlias("UiScreenSectionEntity", "sectionId", null, null, null, null, null);
    
      EntityCondition condition = new EntityConditionList(UtilMisc.toList(
          new EntityExpr("sectionId", EntityOperator.EQUALS, sectionId)),
          EntityOperator.AND);

            try {
                return EntityHelper.findByCondition( delegator, dve, condition, orderBy);
            } catch (GenericEntityException e) {
View Full Code Here

     */
    public static List findByAnd(String entity, List entityExpressions,
        List orderBy, UserInfo userInfo, SecurityLinkInfo securityInfo,
        GenericDelegator delegator, String securityType) throws GenericEntityException {
        HashMap equalsMap = new HashMap();
        EntityExpr entityExpr = null;
        QueryInfo queryInfo = new QueryInfo( delegator, entity);

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

            Object lhs = (Object) entityExpr.getLhs();
            Object rhs = (Object) entityExpr.getRhs();
      EntityComparisonOperator op = (EntityComparisonOperator) entityExpr.getOperator();

            if (lhs instanceof EntityAttribute &&
                    rhs instanceof EntityAttribute) {
                lhs = (EntityAttribute) lhs;
                rhs = (EntityAttribute) rhs;
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.