Skip to content

Fix Enum ARRAY-mapping for extended classes.#164

Merged
signedav merged 2 commits intomainfrom
bagof-iliname
Feb 3, 2026
Merged

Fix Enum ARRAY-mapping for extended classes.#164
signedav merged 2 commits intomainfrom
bagof-iliname

Conversation

@signedav
Copy link
Member

Fix that colums of tables of extended classes cannot consider meta attributes, because they are stored according to the iliname - and an attribute of the base class that is used in a table of an extended class has still the iliname of the base class - thats why it now checks its real iliname instead of concatinating it from the tables iliname.

The example illuminates it:

MODEL BagOfEnumBase(en) AT "https://modelbaker.ch" VERSION "2023-03-29" =
  [...]
    CLASS Strasse =
        Name : MANDATORY TEXT*99;
        !!@ili2db.mapping=ARRAY
        Mat : BAG {1..*} OF BagOfEnumBase.Material_;
        Geometrie : MANDATORY BagOfEnumBase.CHLine;
    END Strasse;

And then extend it:

MODEL BagOfEnumExt (en) AT "https://modelbaker.ch" VERSION "2023-03-29" =
  IMPORTS BagOfEnumBase;
     [...]
    CLASS Strasse (EXTENDED)=
        Bemerkung: TEXT;
    END Strasse; 

(or with extra meta attribute file - like in the tests)

Before it created the table from the extended strasse. There it checked "BagOfEnumExt.Strassen.Strasse.Mat" for the entry in the t_ili2db_meta_attr table. But this was wrong. There is no ili-element like this. Mat is definitely an element of BagOfEnumBase.

With the new way of getting the ilielement it's much more stable and fixes this issue.

…tributes, because they are stored according to the iliname - and an attribute of the base class that is used in a table of an extended class has still the iliname of the base class - thats why it now checks its real iliname instead of concatinating it from the tables iliname.
@signedav signedav requested a review from gacarrillor January 30, 2026 16:41
@gacarrillor
Copy link
Member

@signedav, is there something critical with the test failures?

@signedav
Copy link
Member Author

signedav commented Feb 3, 2026

I think I have to fix it.

@signedav
Copy link
Member Author

signedav commented Feb 3, 2026

The query is correct, but the other tests were no longer correct. They were not tackled by the malfunction before, but checked the "wrong" values though

@signedav signedav merged commit c11a756 into main Feb 3, 2026
6 of 7 checks passed
@signedav signedav deleted the bagof-iliname branch February 3, 2026 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants