Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: EXPOSED-320 Many-to-many relation with extra columns #2204

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Commits on Sep 20, 2024

  1. feat!: EXPOSED-320 Many-to-many relation with extra columns

    An intermediate table is defined to link a many-to-many relation between 2 IdTables,
    with references defined using via(). If this intermediate table is defined with
    additional columns, these are not accessible through the linked entities.
    
    This PR refactors the InnerTableLink logic to include additional columns in generated
    SQL, which can be accessed as a regular field on one of the referencing entities.
    It also allows the possibility to access the additional data as a new entity type,
    which wraps the main child entity along with the additional fields. This is accomplished
    with the introduction of InnerTableLinkEntity.
    bog-walk committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    c27defa View commit details
    Browse the repository at this point in the history
  2. feat!: EXPOSED-320 Many-to-many relation with extra columns

    - Remove approach to set/get additional data from an existing entity object field.
    This requires some UX concerns answered, for example, concerning caching. Would the
    wrapped entity (if loaded from a query of its own table) override the entity+data
    loaded from the many-to-many query? Would updating the field mean the reference
    should also be trigger a delete+insert?
    - Fix issue with updating and caching new additional data
    bog-walk committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    41d9a75 View commit details
    Browse the repository at this point in the history
  3. feat!: EXPOSED-320 Many-to-many relation with extra columns

    - Fix detekt issue
    bog-walk committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    8adc0aa View commit details
    Browse the repository at this point in the history
  4. feat!: EXPOSED-320 Many-to-many relation with extra columns

    - Add more tests (particularly for update) & rename test classes
    - Refactor cache to ensure no overlap with wrapped type. Each link entity is now
    stored by its target column, source column, and target id (stored in entity)
    - Move new entity classes to own file
    - Refactor logic for deleting cached entities
    bog-walk committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    a99b3f3 View commit details
    Browse the repository at this point in the history
  5. feat!: EXPOSED-320 Many-to-many relation with extra columns

    - Fix KDocs samples
    bog-walk committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    0562b39 View commit details
    Browse the repository at this point in the history