Uploaded image for project: 'OASIS Open Data Protocol (OData) TC'
  1. OASIS Open Data Protocol (OData) TC
  2. ODATA-531

Simplify OptimisticConcurrency in Core vocabulary

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: V4.0_CS01
    • Fix Version/s: V4.0_CSD03
    • Component/s: CSDL XML, Vocabularies
    • Labels:
      None
    • Environment:

      [Applied]

      Description

      The OptimisticConcurrencyControl term in the Core vocabulary currently defines a complex type that contains a single collection-valued property:

      <Term Name="OptimisticConcurrencyControl" Type="Core.OptimisticConcurrencyControlType" AppliesTo="EntitySet">
      <Annotation Term="Core.Description" String="If present, the annotated entity set uses optimistic concurrency control" />
      </Term>
      <ComplexType Name="OptimisticConcurrencyControlType">
      <Property Name="ETagDependsOn" Type="Collection(Edm.PropertyPath)" Nullable="true">
      <Annotation Term="Core.Description" String="The ETag is computed from these properties" />
      </Property>
      </ComplexType>

      This intermediate complex type means that applying the vocabulary requires an extra <Record> and <PropertyValue> wrapper:

      <EntitySet Name="Entities" Type="Self.Entity">
      <Annotation Term="Core.OptimisticConcurrencyControl">
      <Record>
      <PropertyValue Name="ETagDependsOn">
      <Collection>
      <PropertyPath>LastModified</PropertyPath>
      </Collection>
      </PropertyValue>
      </Record>
      </Annotation>
      </EntitySet>

      This is unnecessarily cumbersome. We can remove the extra complex type and just create a term whose type is Collection(Edm.NavigationPropertyPath), as in:

      <Term Name="OptimisticConcurrencyControlProperties" Type="Collection(Edm.PropertyPath)" AppliesTo="EntitySet">
      <Annotation Term="Core.Description" String="The set of properties that are used to compute the ETag" />
      </Term>

      Which would be applied much more simply as:

      <EntitySet Name="Entities" Type="Self.Entity">
      <Annotation Term="Core.OptimisticConcurrencyControlProperties">
      <Collection>
      <PropertyPath>LastModified</PropertyPath>
      </Collection>
      </Annotation>
      </EntitySet>

      I think these annotations will be common, so having a simpler way to express is significant.

        Attachments

          Activity

            People

            • Assignee:
              handl Ralf Handl
              Reporter:
              mikep Michael Pizzo (Inactive)
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: