LOG.debug("Found link for navigation property: {}", propertyName); StructuralProperty property = entityType.getStructuralProperty(propertyName); if (!(property instanceof NavigationProperty)) { throw new ODataUnmarshallingException("The request contains a navigation link '" + propertyName +
LOG.debug("Found link for navigation property: {}", propertyName); StructuralProperty property = entityType.getStructuralProperty(propertyName); if (!(property instanceof NavigationProperty)) { throw new ODataUnmarshallingException("The request contains a navigation link '" + propertyName +
/** * Get the 'Structural Property' from the given 'Entity Data Model' and 'Structured Type' looking up all the base * types recursively. * * @param entityDataModel The given 'Entity Data Model'. * @param structuredType The given 'Structured Type'. * @param propertyName The name of the property to look up. * @return The 'Structural Property' or {@code null} if not found. */ public static StructuralProperty getStructuralProperty(EntityDataModel entityDataModel, StructuredType structuredType, String propertyName) { StructuralProperty structuralProperty = structuredType.getStructuralProperty(propertyName); if (structuralProperty != null) { return structuralProperty; } else { // Look up recursively in the 'base type' String baseTypeName = structuredType.getBaseTypeName(); if (!isNullOrEmpty(baseTypeName)) { Type baseType = entityDataModel.getType(baseTypeName); if (baseType != null && baseType instanceof StructuredType) { return getStructuralProperty(entityDataModel, (StructuredType) baseType, propertyName); } } } return null; }
/** * Get the 'Structural Property' from the given 'Entity Data Model' and 'Structured Type' looking up all the base * types recursively. * * @param entityDataModel The given 'Entity Data Model'. * @param structuredType The given 'Structured Type'. * @param propertyName The name of the property to look up. * @return The 'Structural Property' or {@code null} if not found. */ public static StructuralProperty getStructuralProperty(EntityDataModel entityDataModel, StructuredType structuredType, String propertyName) { StructuralProperty structuralProperty = structuredType.getStructuralProperty(propertyName); if (structuralProperty != null) { return structuralProperty; } else { // Look up recursively in the 'base type' String baseTypeName = structuredType.getBaseTypeName(); if (!isNullOrEmpty(baseTypeName)) { Type baseType = entityDataModel.getType(baseTypeName); if (baseType != null && baseType instanceof StructuredType) { return getStructuralProperty(entityDataModel, (StructuredType) baseType, propertyName); } } } return null; }