OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

odata message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: [OASIS Issue Tracker] (ODATA-976) Support partial keys


     [ https://issues.oasis-open.org/browse/ODATA-976?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Pizzo updated ODATA-976:
--------------------------------

    Description: 
In OData-945 we added support for composite keys expressed through key-as-segment, which begged the question what happens if only part of the key is specified.  It seems reasonalbe that, in this case, we would do a partial filtering of the results.

i.e.;

    AccountingDocuments/SAP/2016

would identify the subset of accounting documents for a company and year, and

    AccountingDocuments/SAP

would identify the subset of accounting documents for a company.

Services could optionally support this as a shorthand for 

   GET AccountingDocuments?$filter=CompanyCode eq 'SAP' and Year eq '2016'

and

   GET AccountingDocuments?$filter=CompanyCode eq 'SAP'

If supported, we should define consistent semantics across both key-as-segment and parens-syntax.

  was:
Generalize the rules in ODATA-799 to allow key-as-segment notation also for multi-part keys.

Example: an accounting document is identified by the company code, the year, and the (auto-incremented) document number:

      <EntityType Name="AccountingDocument">
        <Key>
          <PropertyRef Name="CompanyCode" />
          <PropertyRef Name="Year" />
          <PropertyRef Name="DocumentNumber" />
        </Key>
      </EntityType>

Taking into account the order of <PropertyRef> elements within the <Key> element a single accounting document can be identified as

    GET AccountingDocuments/SAP/2016/4329043280

An optional extension would be to treat the multi-part key as a "folder structure", i.e.

    AccountingDocuments/SAP/2016

would identify the subset of accounting documents for a company and year, and

    AccountingDocuments/SAP

would identify the subset of accounting documents for a company.

Services could optionally support this as a shorthand for 

   GET AccountingDocuments?$filter=CompanyCode eq 'SAP' and Year eq '2016'

and

   GET AccountingDocuments?$filter=CompanyCode eq 'SAP'




> Support partial keys
> --------------------
>
>                 Key: ODATA-976
>                 URL: https://issues.oasis-open.org/browse/ODATA-976
>             Project: OASIS Open Data Protocol (OData) TC
>          Issue Type: Sub-task
>          Components: OData URL Conventions
>    Affects Versions: V4.0_ERRATA02
>         Environment: New Query Capabilities
>            Reporter: Ralf Handl
>             Fix For: V4.01_WD01
>
>
> In OData-945 we added support for composite keys expressed through key-as-segment, which begged the question what happens if only part of the key is specified.  It seems reasonalbe that, in this case, we would do a partial filtering of the results.
> i.e.;
>     AccountingDocuments/SAP/2016
> would identify the subset of accounting documents for a company and year, and
>     AccountingDocuments/SAP
> would identify the subset of accounting documents for a company.
> Services could optionally support this as a shorthand for 
>    GET AccountingDocuments?$filter=CompanyCode eq 'SAP' and Year eq '2016'
> and
>    GET AccountingDocuments?$filter=CompanyCode eq 'SAP'
> If supported, we should define consistent semantics across both key-as-segment and parens-syntax.



--
This message was sent by Atlassian JIRA
(v6.2.2#6258)


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]