private List<KeyPredicate> getKeys(EdmEntitySet entitySet, Map<String, Object> navigatedData, boolean isDraft) throws EdmException { List<KeyPredicate> allKeys = new ArrayList<>(); List<EdmProperty> entityKeys = entitySet.getEntityType().getKeyProperties(); for(Map.Entry<String, Object> properties : navigatedData.entrySet()) { String key = properties.getKey(); String literal = properties.getValue().toString(); EdmProperty entityKeyProperty = this.getEntityKey(entityKeys, key, isDraft); if(entityKeyProperty != null){ KeyPredicateImpl keyPredicate = new KeyPredicateImpl(literal, entityKeyProperty); allKeys.add(keyPredicate); } } return allKeys; }
for(String key:entityType.getKeyPropertyNames()) { if(!key.equalsIgnoreCase(DraftUtilsV2.DRAFTS_ISACTIVE_ENTITY)) { KeyPredicateImpl keyParam = new KeyPredicateImpl(ent.get(key).toString(), new EdmProperty() { @Override public EdmAnnotations getAnnotations() throws EdmException {
private List<KeyPredicate> getKeysFromFunctionImportParams(GetFunctionImportUriInfo uriInfo, boolean removeIsActiveEntity) throws EdmException { List<KeyPredicate> allKeys = new ArrayList<>(); Map<String, EdmLiteral> parameters = uriInfo.getFunctionImportParameters(); List<EdmProperty> keyList = uriInfo.getFunctionImport().getEntitySet().getEntityType().getKeyProperties(); Iterator<EdmProperty> keysPropItr = keyList.iterator(); while(keysPropItr.hasNext()){ EdmProperty property = keysPropItr.next(); if(removeIsActiveEntity && DraftUtilsV2.DRAFTS_ISACTIVE_ENTITY.equalsIgnoreCase(property.getName())){ continue; } String literal = parameters.get(property.getName()).getLiteral(); allKeys.add(new KeyPredicateImpl(literal, property)); } return allKeys; }
keyPredicates.add(new KeyPredicateImpl(uriLiteral.getLiteral(), keyProperty));
keyPredicates.add(new KeyPredicateImpl(uriLiteral.getLiteral(), keyProperty));
keyPredicates.add(new KeyPredicateImpl(uriLiteral.getLiteral(), keyProperty));
KeyPredicateImpl predicate = new KeyPredicateImpl(literal, key); predicates.add(predicate); createView.getNavigationSegments().clear();