Skip to content

ReferenceSet Associations from OData *-to-* Navigation Properties #1231

Description

@acarum

When importing an OData entity that has one or more collection-to-collection (-to-) navigation properties, mxcli (and Mendix itself)
auto-creates ReferenceSet associations for each such property. These associations are invalid for external OData entities and cause CE6618 at
mxbuild time. There is currently no MDL statement to remove them, and neither check nor lint detect them — making the only available fix a
manual Studio Pro step.


Steps to Reproduce

  1. Import an OData entity that exposes -to- navigation properties:
    CREATE OR MODIFY EXTERNAL ENTITIES FROM "ConnectorModule"."App" INTO "MyModule"
    ENTITIES ("Buffer");
  2. Run ./mxcli check script.mdl -p System.mpr --references → no errors.
  3. Run ./mxcli lint -p System.mpr → no errors.
  4. Run ./mxcli docker check -p System.mpr → CE6618 for each auto-created ReferenceSet association.

Observed Behavior

  • mxcli creates ReferenceSet associations automatically (one per -to- navigation property on the imported entity).
  • Example associations auto-created during a Buffer entity import:
    • MyModule.Associations
    • MyModule.CapacityTypes
    • MyModule.Definitions
  • These associations are invalid for external entities and mxbuild rejects them with CE6618.
  • check and lint are both silent — the error is invisible until docker check (~25s gate).
  • There is no MDL statement to remove them (DROP ASSOCIATION does not exist).
  • The only fix is to delete each association manually in Studio Pro.

Expected Behavior / Requested Improvements

  1. Add DROP ASSOCIATION to MDL (highest priority)

This would allow a clean, scriptable workaround immediately after import:

CREATE OR MODIFY EXTERNAL ENTITIES FROM "ConnectorModule"."AppU4DM" INTO "MyModule"
ENTITIES ("Buffer");

DROP ASSOCIATION "MyModule"."Associations";
DROP ASSOCIATION "MyModule"."CapacityTypes";
DROP ASSOCIATION "MyModule"."Definitions";

Without this, any OData entity with -to- navigation properties forces a mandatory manual Studio Pro step that breaks fully automated
migrations.

  1. Emit a warning during import when -to- navigation properties are detected (medium priority)

When CREATE OR MODIFY EXTERNAL ENTITIES FROM detects a collection-to-collection navigation property, mxcli should warn:

Warning: entity 'Buffer' has -to- navigation property 'BufferMaterialItemAssociations'.
A ReferenceSet association will be auto-created and will cause CE6618 at mxbuild.
Remove it manually in Studio Pro or use DROP ASSOCIATION (if available).

  1. Detect CE6618 in check or lint (lower priority)

Since mxcli manages the model, it has enough information to detect invalid ReferenceSet associations on external entities without invoking
mxbuild. Surfacing this at check or lint would reduce the feedback loop from ~25s to ~2s.


Environment

  • mxcli version: (0.23.0)
  • Mendix version: 11.12.4
  • Affected OData entity: any entity with -to- (Collection) navigation properties in its $metadata

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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