Skip to content

Add Support For Composite Keys #15

@natemacinnes

Description

@natemacinnes

Currently the schema only handles a single primary key.

def primary_key_for(entity_name)
  metadata.xpath("//EntityType[@Name='{entity_name}']/Key/PropertyRef").first.attributes['Name'].value
     end

The OData specification supports composite keys, i.e.,

<EntityType Name="RetailTransaction">
    <Key>
        <PropertyRef Name="dataAreaId" />
        <PropertyRef Name="TransactionNumber" />
        <PropertyRef Name="OperatingUnitNumber" />
        <PropertyRef Name="Terminal" />
    </Key>
...
</EntityType>

Not entirely sure of the best approach of handling this just yet, but starting with checking if all keys defined for the Entity in the schema are present before asserting whether the Entity is new or not is probably a good place to start.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions