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

Created on 30 June 2024, 6 months ago
Updated 14 August 2024, 4 months ago

Problem/Motivation

This came up in 🐛 Cannot use UUID as entity ID Needs work .

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 work

Version

11.0 🔥

Component
Entity 

Last updated about 15 hours 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

Production build 0.71.5 2024