Replace DefaultTableMapping::setFieldNames() with ::add*() and ::remove*()

Created on 30 June 2024, 2 days ago

Problem/Motivation

This came up in πŸ› Cannot use UUID as entity ID Needs review .

DefaultTableMapping currently needs to combine a bunch of actual "business logic" which determines which field columns go in to which entity table with a bunch of manual array jumbling (diffing/"value"ing/merging/...).

This makes the code less readable than it could be.

Steps to reproduce

-

Proposed resolution

Replace DefaultTableMapping::setFieldNames() DefaultTableMapping::addFieldNames() and DefaultTableMapping::removeFieldNames().

DefaultTableMapping::addFieldNames() then internally does the "merge -> unique -> value" dance. This allows simplifiying some of the actual business logic. Note that this is never used in any runtime-critical code path so the additional cost incurred by those operations is negligible.

The latter is introduced to bring parity with the current API. It is only used in test code right now, but let's discuss it's future in πŸ“Œ Convert DefaultTableMapping::setFieldNames() and ::setExtraColumns() to protected methods Active which was opened for that exact discussion.

Remaining tasks

User interface changes

-

API changes

Data model changes

-

Release notes snippet

-

πŸ“Œ Task
Status

Needs review

Version

11.0 πŸ”₯

Component
EntityΒ  β†’

Last updated 18 minutes ago

Created by

πŸ‡©πŸ‡ͺGermany tstoeckler Essen, Germany

Live updates comments and jobs are added and updated live.
  • Needs change record

    A change record needs to be drafted before an issue is committed. Note: Change records used to be called change notifications.

Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @tstoeckler
  • Status changed to Needs review 2 days ago
  • πŸ‡©πŸ‡ͺGermany tstoeckler Essen, Germany

    Opened a merge request with the change. This will need to be changed to deprecate setFieldNames() before it can go in, but I would like some discussion/agreement that this makes sense first, before going ahead with that. Thus, marking "Needs review".

  • Pipeline finished with Failed
    2 days ago
    Total: 564s
    #212242
  • Pipeline finished with Success
    1 day ago
    Total: 632s
    #212848
Production build 0.69.0 2024