/** * @param annotationGrp * @param complexType * @param complexPropertyName */ private void addAnnotationsToComplexTypeProperties(CsdlAnnotations annotationGrp, CsdlComplexType complexType, CsdlProperty complexPropertyName) { for (CsdlAnnotation annotation : annotationGrp.getAnnotations()) { if (!compareAnnotations(complexType.getProperty( complexPropertyName.getName()).getAnnotations(), annotation)) { complexType.getProperty(complexPropertyName.getName()).getAnnotations().add(annotation); } } }
/** * fetch the actual navigation property from the remaning path * @param remainingPath * @param strNavProperty * @param sourceTypeHavingNavProp * @return CsdlNavigationProperty */ private CsdlNavigationProperty fetchNavigationProperty(String remainingPath, String strNavProperty, CsdlStructuralType sourceTypeHavingNavProp) { String[] paths = remainingPath.split("/"); for (String path : paths) { FullQualifiedName fqName = null; if (sourceTypeHavingNavProp instanceof CsdlComplexType) { fqName = ((CsdlComplexType)sourceTypeHavingNavProp).getProperty(path).getTypeAsFQNObject(); } else if (sourceTypeHavingNavProp instanceof CsdlEntityType) { fqName = ((CsdlEntityType)sourceTypeHavingNavProp).getProperty(path).getTypeAsFQNObject(); } if (fqName != null) { String namespace = aliasNamespaceMap.get(fqName.getNamespace()); fqName = namespace != null ? new FullQualifiedName(namespace, fqName.getName()) : fqName; } sourceTypeHavingNavProp = csdlEntityTypesMap.get(fqName) != null ? csdlEntityTypesMap.get(fqName) : csdlComplexTypesMap.get(fqName); } return sourceTypeHavingNavProp.getNavigationProperty(strNavProperty); }
/** * fetch the actual navigation property from the remaning path * @param remainingPath * @param strNavProperty * @param sourceTypeHavingNavProp * @return CsdlNavigationProperty */ private CsdlNavigationProperty fetchNavigationProperty(String remainingPath, String strNavProperty, CsdlStructuralType sourceTypeHavingNavProp) { String[] paths = remainingPath.split("/"); for (String path : paths) { FullQualifiedName fqName = null; if (sourceTypeHavingNavProp instanceof CsdlComplexType) { fqName = ((CsdlComplexType)sourceTypeHavingNavProp).getProperty(path).getTypeAsFQNObject(); } else if (sourceTypeHavingNavProp instanceof CsdlEntityType) { fqName = ((CsdlEntityType)sourceTypeHavingNavProp).getProperty(path).getTypeAsFQNObject(); } if (fqName != null) { String namespace = aliasNamespaceMap.get(fqName.getNamespace()); fqName = namespace != null ? new FullQualifiedName(namespace, fqName.getName()) : fqName; } sourceTypeHavingNavProp = csdlEntityTypesMap.get(fqName) != null ? csdlEntityTypesMap.get(fqName) : csdlComplexTypesMap.get(fqName); } return sourceTypeHavingNavProp.getNavigationProperty(strNavProperty); }
for (CsdlProperty complexPropertyName : complexType.getProperties()) { if (!isComplexPropAnnotationsCleared) { complexType.getProperty(complexPropertyName.getName()).getAnnotations().clear();