title: Is the SAP Cloud SDK VDM Generator handling EDMX annotations correctly?
body: <p>In our context we are using a custom OData interface on S/4 side which is generated from a CDS view, which again has annotations. The resulting EDMX is of the following structure:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;edmx:Edmx xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:sap="http://www.sap.com/Protocols/SAPData" Version="1.0"&gt;
      &lt;edmx:DataServices m:DataServiceVersion="2.0"&gt;
          &lt;Schema xmlns="http://schemas.microsoft.com/ado/2008/09/edm" Namespace="vdmerror"&gt;
              &lt;EntityType Name="TestEntity"&gt;
                  &lt;Key&gt;
                      &lt;PropertyRef Name="TestEntityID"/&gt;
                  &lt;/Key&gt;
                  &lt;Property Name="TestEntityID" Nullable="false" Type="Edm.String"/&gt;
                  &lt;Property Name="SomeField" Type="Edm.String"/&gt;
              &lt;/EntityType&gt;
              &lt;EntityType Name="FieldValues"&gt;
                  &lt;Key&gt;
                      &lt;PropertyRef Name="FieldValuesID"/&gt;
                  &lt;/Key&gt;
                  &lt;Property Name="FieldValuesID" Nullable="false" Type="Edm.String"/&gt;
                  &lt;Property Name="SomeAdditionalProperty" Type="Edm.String"/&gt;
              &lt;/EntityType&gt;
              &lt;EntityContainer Name="default" m:IsDefaultEntityContainer="true"&gt;
                  &lt;EntitySet EntityType="vdmerror.TestEntity" Name="TestEntity" sap:searchable="true"/&gt;
                  &lt;EntitySet EntityType="vdmerror.FieldValues" Name="FieldValues" sap:searchable="true"/&gt;
              &lt;/EntityContainer&gt;
              &lt;Annotations Target="vdmerror.TestEntity/SomeField" xmlns="http://docs.oasis-open.org/odata/ns/edm"&gt;
                  &lt;Annotation Term="Common.ValueList"&gt;
                      &lt;Record&gt;
                          &lt;PropertyValue Property="Label" String="Value Help for Field"/&gt;
                          &lt;PropertyValue Property="CollectionPath" String="FieldValues"/&gt;
                          &lt;PropertyValue Property="SearchSupported" Bool="true"/&gt;
                          &lt;PropertyValue Property="Parameters"&gt;
                              &lt;Collection&gt;
                                  &lt;Record Type="Common.ValueListParameterInOut"&gt;
                                      &lt;PropertyValue Property="LocalDataProperty" PropertyPath="FieldValuesID"/&gt;
                                      &lt;PropertyValue Property="ValueListProperty" String="FieldValuesID"/&gt;
                                  &lt;/Record&gt;
                              &lt;/Collection&gt;
                          &lt;/PropertyValue&gt;
                      &lt;/Record&gt;
                  &lt;/Annotation&gt;
              &lt;/Annotations&gt;
              &lt;atom:link rel="self" href="/api/odata/v2/vdmerror/$metadata" xmlns:atom="http://www.w3.org/2005/Atom" /&gt;
              &lt;atom:link rel="latest-version" href="/api/odata/v2/vdmerror/$metadata" xmlns:atom="http://www.w3.org/2005/Atom" /&gt;
          &lt;/Schema&gt;
      &lt;/edmx:DataServices&gt;
  &lt;/edmx:Edmx&gt;
  
  </code></pre>
  
  <p>In SDK versions &lt; 3.6 this worked fine in that also for the ValueEntity entity set a FluentHelper was generated. Afterwards not anymore. Debugging the generation process we found out that the allowed functions which are checked for generating the FluentHelper are identified in the AllowedFunctionsResolver, which has two different sources for the allowed functions: either from the annotations or the sap-attributes on the entity sets.</p>
  
  <p>In our case, the annotations are used because they are present. But unfortunately it keeps the allowed functions in a map were the key is derived from the target attribute in the annotations element (in our case ValueField, see AllowedFunctionsResolver.readOdataSpecFromMetadataFile(...)). Later on in the process however when iterating over the entity sets, the entity name is used as the key for the lookup in the map of allowed functions, where it of course finds no entry and does not generate the FluentHelper interface (s. NamespaceClassGenerator.processEntitySet(...)).</p>
  
  <p>If instead the PropertyValue of the CollectionPath attribute would be used, this would work since it contains the reference to the entity set. So the question is whether the current behaviour is really the intended one?</p>
  
  <p>Our current workaround is to delete the Annotations from the EDMX prior to generation, however this is a bit error prone, although also this could be automated of course.</p>