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

Define an Edm.AnyType to allow functions to apply to entity sets of any entity type

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: CSDL XML
    • Labels:
      None
    • Environment:

      [Proposed]

    • Proposal:
      Hide

      Add the following types to the list of built-in types:
      -Edm.PrimitiveType
      -Edm.ComplexType
      -Edm.EntityType

      Conceptually, these are the (default) abstract base types for primitive types, complex types, and entity types, respectively, and can be used anywhere the corresponding type can be used, except:
      1) you can't use Edm.EntityType as the type for a named top-level entity in your container.
      2) you can't use Edm.EntityType as the type of an entityset (because all entities in an entityset must currently have the same key fields to uniquely identify it within the set)
      3) in the base attribute of an EntityType/ComplexType definition (it's assumed)

      Examples of where you can use these abstract base types, as appropriate:
      -as the type of a collection (i.e., Collection(Edm.EntityType) in a navigation property)
      -in a TypeDefinition
      -in a Property definition (Edm.ComplexType, Edm.PrimitiveType, Collection(Edm.ComplexType), Collection(Edm.PrimitiveType)
      -in a navigation property definition (Edm.EntityType, Collection(Edm.EntityType)
      -in a Parameter definition
      -as a Function returntype
      -in a Term definition

      Note that you can cast the results of a function, for example, to a particular type in order to access it's properties (i.e., in a $filter, $expand, or $orderby). For example:
      ~MyFunctionThatReturnsAnyEntityType()/MyModel.Customer?$filter=FirstName eq 'Ralf'
      This filters the results to only those that match the specified type and casts the results to that type.

      Accepted: https://www.oasis-open.org/committees/download.php/48097/odata-meeting-23_on-20130130_31-F2F-minutes.html#odata-16

      Show
      Add the following types to the list of built-in types: -Edm.PrimitiveType -Edm.ComplexType -Edm.EntityType Conceptually, these are the (default) abstract base types for primitive types, complex types, and entity types, respectively, and can be used anywhere the corresponding type can be used, except: 1) you can't use Edm.EntityType as the type for a named top-level entity in your container. 2) you can't use Edm.EntityType as the type of an entityset (because all entities in an entityset must currently have the same key fields to uniquely identify it within the set) 3) in the base attribute of an EntityType/ComplexType definition (it's assumed) Examples of where you can use these abstract base types, as appropriate: -as the type of a collection (i.e., Collection(Edm.EntityType) in a navigation property) -in a TypeDefinition -in a Property definition (Edm.ComplexType, Edm.PrimitiveType, Collection(Edm.ComplexType), Collection(Edm.PrimitiveType) -in a navigation property definition (Edm.EntityType, Collection(Edm.EntityType) -in a Parameter definition -as a Function returntype -in a Term definition Note that you can cast the results of a function, for example, to a particular type in order to access it's properties (i.e., in a $filter, $expand, or $orderby). For example: ~MyFunctionThatReturnsAnyEntityType()/MyModel.Customer?$filter=FirstName eq 'Ralf' This filters the results to only those that match the specified type and casts the results to that type. Accepted: https://www.oasis-open.org/committees/download.php/48097/odata-meeting-23_on-20130130_31-F2F-minutes.html#odata-16
    • Resolution:
      Show
      https://www.oasis-open.org/committees/download.php/48171/odata-core-v1.0-wd01-part3-csdl-2013-02-07-RH.doc https://tools.oasis-open.org/version-control/browse/wsvn/odata/trunk/spec/schemas/csdl.xsd?rev=175 Accepted: https://www.oasis-open.org/committees/download.php/48269/odata-meeting-25_on-20130214-minutes.html#odata-16

      Description

      OData might be extended to allow functions to apply to entity sets of any entity type. This could greatly reduce the number of functions that need to be defined for OData Extension for Temporal Data.

      This can also greatly simplify the Data Aggregation Extension, especially the WHERE-GROUPBY-HAVING dilemma.

      Consider a general Edm.Any type that can be used in Type= throughout the CSDL.

        Attachments

          Activity

            People

            • Assignee:
              handl Ralf Handl
              Reporter:
              andrew.eisenberg Andrew Eisenberg (Inactive)
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: