[ https://issues.apache.org/jira/browse/OLINGO-1570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17869981#comment-17869981 ]
Patrick Rosendaal commented on OLINGO-1570: ------------------------------------------- Hi, We have developed a proof-of-concept to be able to use Alternate Keys in a server running Olingo V4. The code assumes the application-specific code populates the datamodel with the necessary Org.OData.Core.V1.AlternateKey annotations. The key definitions are read from the model in EdmEntityTypeImpl.checkBaseType(). We expanded ParserHelper to recognize the keys in OData requests. We did not yet clean the code as we first would like feedback from the Olingo maintainers if the basic approach seems viable. We also did not write tests, which we intend to do before the actual cleaning. So we would very much appreciate any feedback about our solution. > Support of Alternate Keys from OData Version 4.01 > ------------------------------------------------- > > Key: OLINGO-1570 > URL: https://issues.apache.org/jira/browse/OLINGO-1570 > Project: Olingo > Issue Type: New Feature > Components: odata4-server > Reporter: Boris Fierlings > Priority: Minor > Attachments: [OLINGO-1570]-proof_of_concept.patch > > > OData Version 4.01 defines [Alternate > Keys|http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part2-url-conventions.html#sec_AlternateKeys], > which is a useful feature and should be implemented by OLingo. > {quote} > h3. 4.3.5 [Alternate > Keys|http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part2-url-conventions.html#sec_AlternateKeys] > In addition to the canonical (primary) key an entity set or entity type can > specify one or more alternate keys with the > [Core.AlternateKeys|https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Core.V1.md#AlternateKeys] > term (see > [*[OData-VocCore]*|http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part2-url-conventions.html#VocCore]). > Entities can be addressed via an alternate key using the same > parentheses-style convention as for the canonical key, with one difference: > single-part alternate keys MUST specify the key property name to > unambiguously determine the alternate key. > Example 24: the same employee identified via the alternate key SSN, the > canonical (primary) key ID using the non-canonical long form with specified > key property name, and the canonical short form without key property name > [http://host/service/Employees(SSN='123-45-6789]') > [http://host/service/Employees(ID='A1245]') > [http://host/service/Employees('A1245]') > {quote} -- This message was sent by Atlassian Jira (v8.20.10#820010)