Package org.ofbiz.entity.model

Examples of org.ofbiz.entity.model.ModelKeyMap


    // select X from productCategory pc, productCategoryAttribute pca where pc.productCategoryId = pca.productCategoryId
    //     and pca.attrName = "OWNER" and pca.attrVal = <accountId>
    DynamicViewEntity dve = EntityHelper.createDynamicViewEntity( delegator, "ProductCategory");
    dve.addMemberEntity("ProductCategoryAttribute", "ProductCategoryAttribute");
    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"),
View Full Code Here


    // Find the last query used by this party ID for this 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 = -1 and ss.section_name = <section_name>
    //      and s.screen_name = <screenName> and s.screen_id = ss.screen_id order by query_name      
    DynamicViewEntity dve = EntityHelper.createDynamicViewEntity( delegator, "UiQuery");
    dve.addMemberEntity("UiScreenSection", "UiScreenSection");
    dve.addViewLink("UiQuery", "UiScreenSection", Boolean.FALSE, UtilMisc.toList(new ModelKeyMap("sectionId", "sectionId")));
    dve.addMemberEntity("UiScreen", "UiScreen");
    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"),
View Full Code Here

        // Find the last query used by this party ID for this 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 = <party_id> and ss.section_name = <section_name>
        //      and s.screen_name = <screenName> and s.screen_id = ss.screen_id and q.queryName = <queryName>       
    DynamicViewEntity dve = EntityHelper.createDynamicViewEntity( delegator, "UiQuery");
    dve.addMemberEntity("UiScreenSection", "UiScreenSection");
    dve.addViewLink("UiQuery", "UiScreenSection", Boolean.FALSE, UtilMisc.toList(new ModelKeyMap("sectionId", "sectionId")));
    dve.addMemberEntity("UiScreen", "UiScreen");
    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),
View Full Code Here

            throw new GenericModelException("Could not find relation for relationName: " + relationName + " for value " + value);
        }

        Map<String, Object> fields = FastMap.newInstance();
        for (int i = 0; i < relation.getKeyMapsSize(); i++) {
            ModelKeyMap keyMap = relation.getKeyMap(i);
            fields.put(keyMap.getRelFieldName(), value.get(keyMap.getFieldName()));
        }

        return this.removeByAnd(relation.getRelEntityName(), fields, doCacheClear);
    }
View Full Code Here

        Map<String, Object> fields = FastMap.newInstance();
        if (byAndFields != null) {
            fields.putAll(byAndFields);
        }
        for (int i = 0; i < relation.getKeyMapsSize(); i++) {
            ModelKeyMap keyMap = relation.getKeyMap(i);
            fields.put(keyMap.getRelFieldName(), value.get(keyMap.getFieldName()));
        }

        return this.findByAnd(relation.getRelEntityName(), fields, orderBy);
    }
View Full Code Here

        Map<String, Object> fields = FastMap.newInstance();
        if (byAndFields != null) {
            fields.putAll(byAndFields);
        }
        for (int i = 0; i < relation.getKeyMapsSize(); i++) {
            ModelKeyMap keyMap = relation.getKeyMap(i);
            fields.put(keyMap.getRelFieldName(), value.get(keyMap.getFieldName()));
        }

        return GenericPK.create(this, relatedEntity, fields);
    }
View Full Code Here

            throw new GenericModelException("Could not find relation for relationName: " + relationName + " for value " + value);
        }

        Map<String, Object> fields = FastMap.newInstance();
        for (int i = 0; i < relation.getKeyMapsSize(); i++) {
            ModelKeyMap keyMap = relation.getKeyMap(i);
            fields.put(keyMap.getRelFieldName(), value.get(keyMap.getFieldName()));
        }

        return this.findByAndCache(relation.getRelEntityName(), fields, null);
    }
View Full Code Here

            throw new GenericModelException("Relation is not a 'one' or a 'one-nofk' relation: " + relationName + " of entity " + value.getEntityName());
        }

        Map<String, Object> fields = FastMap.newInstance();
        for (int i = 0; i < relation.getKeyMapsSize(); i++) {
            ModelKeyMap keyMap = relation.getKeyMap(i);
            fields.put(keyMap.getRelFieldName(), value.get(keyMap.getFieldName()));
        }

        return this.findByPrimaryKey(relation.getRelEntityName(), fields);
    }
View Full Code Here

            throw new GenericModelException("Relation is not a 'one' or a 'one-nofk' relation: " + relationName + " of entity " + value.getEntityName());
        }

        Map<String, Object> fields = FastMap.newInstance();
        for (int i = 0; i < relation.getKeyMapsSize(); i++) {
            ModelKeyMap keyMap = relation.getKeyMap(i);
            fields.put(keyMap.getRelFieldName(), value.get(keyMap.getFieldName()));
        }

        return this.findByPrimaryKeyCache(relation.getRelEntityName(), fields);
    }
View Full Code Here

                            Map<String, Object> relationMap = FastMap.newInstance();
                            ModelRelation relation = entity.getRelation(r);
                            List<Map<String, Object>> keysList = FastList.newInstance();
                            for (int km = 0; km < relation.getKeyMapsSize(); km++) {
                                Map<String, Object> keysMap = FastMap.newInstance();
                                ModelKeyMap keyMap = relation.getKeyMap(km);
                                String fieldName = null;
                                String relFieldName = null;
                                if (keyMap.getFieldName().equals(keyMap.getRelFieldName())) {
                                    fieldName = keyMap.getFieldName();
                                    relFieldName = "aa";
                                } else {
                                    fieldName = keyMap.getFieldName();
                                    relFieldName = keyMap.getRelFieldName();
                                }
                                keysMap.put("row", km + 1);
                                keysMap.put("fieldName", fieldName);
                                keysMap.put("relFieldName", relFieldName);
                                keysList.add(keysMap);
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.