Package org.ofbiz.entity.model

Examples of org.ofbiz.entity.model.ModelKeyMap


            product_feature_appl.product_feature_id = product_feature.product_feature_id and
            product_feature.product_feature_type_id = 'SOFTWARE_FEATURE'
        */
        DynamicViewEntity dve = EntityHelper.createDynamicViewEntity( delegator, "ProductFeature");
    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)),
View Full Code Here


                    restOfStatement.append(" ON ");

                    StringBuilder condBuffer = new StringBuilder();

                    for (int j = 0; j < viewLink.getKeyMapsSize(); j++) {
                        ModelKeyMap keyMap = viewLink.getKeyMap(j);
                        ModelField linkField = linkEntity.getField(keyMap.getFieldName());
                        if (linkField == null) {
                            throw new GenericModelException("Invalid field name in view-link key-map for the " + viewLink.getEntityAlias() + " and the " + viewLink.getRelEntityAlias() + " member-entities of the " + modelViewEntity.getEntityName() + " view-entity; the field [" + keyMap.getFieldName() + "] does not exist on the [" + linkEntity.getEntityName() + "] entity.");
                        }
                        ModelField relLinkField = relLinkEntity.getField(keyMap.getRelFieldName());
                        if (relLinkField == null) {
                            throw new GenericModelException("Invalid related field name in view-link key-map for the " + viewLink.getEntityAlias() + " and the " + viewLink.getRelEntityAlias() + " member-entities of the " + modelViewEntity.getEntityName() + " view-entity; the field [" + keyMap.getRelFieldName() + "] does not exist on the [" + relLinkEntity.getEntityName() + "] entity.");
                        }

                        if (condBuffer.length() > 0) {
                            condBuffer.append(" AND ");
                        }
View Full Code Here

      addAlias(firstEntityAlias, firstField, firstFieldAlias);
     
    if ( !secondField.equals(secondFieldAlias))
      addAlias(secondEntityAlias, secondField, secondFieldAlias );
           
    dve.addViewLink(firstEntityAlias, secondEntityAlias, relOptional, UtilMisc.toList(new ModelKeyMap(firstFieldAlias, secondFieldAlias)));
  }
View Full Code Here

    // select X from Deal d, entity_access ea, team_member tm where ea.entity = "Deal" and ea.partyEntityType = "Team"
    //  and ea.party_id = tm.team_id and tm.party_id = <partyId> and ea.entity_id = d.deal_id
    DynamicViewEntity dve = EntityHelper.createDynamicViewEntity( delegator, "Deal");
    dve.addMemberEntity("EntityAccess", "EntityAccess");
    dve.addMemberEntity("TeamMember", "TeamMember");
    dve.addViewLink("Deal", "EntityAccess", Boolean.FALSE, UtilMisc.toList(new ModelKeyMap("dealId", "entityId")));
    dve.addViewLink("EntityAccess", "TeamMember", Boolean.FALSE, UtilMisc.toList(new ModelKeyMap("partyId", "teamId")));
    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(
View Full Code Here

        orderBy.add("description");

    // select X from roleType rt,. code c where rt.roleTypeId = c.codeId and c.codeTypeId = "ROLE_TYPE_SFA" order by description    
    DynamicViewEntity dve = EntityHelper.createDynamicViewEntity( delegator, "RoleType");
    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);
View Full Code Here

        // save the query.
        // select * from UiAttribute a, UIEntity e where e.entity_id = a.entity_id and a.attribute_name = <searchAttrName> and e.entityName = <searchEntityName>
       
        DynamicViewEntity dve = EntityHelper.createDynamicViewEntity( delegator, "UiAttribute");
    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)),
View Full Code Here

              Debug.logError("Invalid Join Condition, attempting to join lookup table to two different entities", module);
              return false;
            }
            joinEntity = relatedEntity;
     
            joinList.add(new ModelKeyMap(attributeValueSource, findAttributeName));
          }
         
        }
      }
     
View Full Code Here

      // Find the last query used by this party ID for this screen section.
      // select X from ui_attribute a, ui_screen_section_entity sse where a.entity_id = sse.entity_id and sse.section_id = <sectionId> order by attribute_name
      DynamicViewEntity dve = EntityHelper.createDynamicViewEntity( delegator, "UiAttribute");
      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);
View Full Code Here

      Iterator keyMapsIterator = relation.getKeyMapsIterator();

      List keyMaps = new ArrayList();           

      while (keyMapsIterator.hasNext()) {
        ModelKeyMap keyMap = (ModelKeyMap) keyMapsIterator.next();

        Debug.logVerbose("Adding to entityClauses: " +
            primaryEntityName + ", " + relatedEntityName + ", " +
            keyMap.getFieldName() + ", " +
            keyMap.getRelFieldName(), module);

        keyMaps.add(keyMap);
      }
           
      queryInfo.addJoin( primaryEntityName, relatedEntityName, Boolean.valueOf(isOuterJoin), keyMaps);
View Full Code Here

    // select X from product p, productAttribute pa where p.productId = pa.productId
    //     and pa.attrName = "OWNER" and pa.attrValue = "<accountId>
    DynamicViewEntity dve = EntityHelper.createDynamicViewEntity( delegator, "Product");
    dve.addMemberEntity("ProductAttribute", "ProductAttribute");
    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"),
View Full Code Here

TOP

Related Classes of org.ofbiz.entity.model.ModelKeyMap

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.