claeis / ili2db

interlis import/export to relational databases
30 stars 30 forks source link

DMAV und --createEnumTabs funktioniert bei einigen Modellen nicht #543

Closed edigonzales closed 3 weeks ago

edigonzales commented 5 months ago

Z.B. DMAV_Bodenbedeckung_V1_0 und DMAV_Grundstuecke_V1_0:

java -jar ili2pg-5.1.0.jar --dbhost localhost --dbport 54321 --dbdatabase edit --dbusr ddluser --dbpwd ddluser --dbschema agi_dmav_bodenbedeckung_v1 --models DMAV_Bodenbedeckung_V1_0 --createEnumTabs --createBasketCol --schemaimport

führt zu folgendem Fehler:

Info: flush(): single updates executed: 0 (StatementExecutionHelper.java:50)
Info: updateTrafoConfig(): INSERT INTO agi_dmav_bodenbedeckung_v2.T_ILI2DB_TRAFO (iliname,tag,setting) VALUES (?,?,?) (TrafoConfig.java:125)
Info: readInheritanceTable(): SELECT thisClass FROM agi_dmav_bodenbedeckung_v2.T_ILI2DB_INHERITANCE (TransferFromIli.java:1213)
Info: updateInheritanceTable(): INSERT INTO agi_dmav_bodenbedeckung_v2.T_ILI2DB_INHERITANCE (thisClass,baseClass) VALUES (?,?) (TransferFromIli.java:1252)
Info: flush(): single updates executed: 11 (StatementExecutionHelper.java:50)
Info: readEnumValueMapFromDb(): SELECT iliCode,dispName,description,itfCode FROM agi_dmav_bodenbedeckung_v2.halignment (EnumValueMap.java:83)
Info: updateMultiEnumTable(): INSERT INTO agi_dmav_bodenbedeckung_v2.halignment (seq,iliCode,itfCode,dispName,inactive,description) VALUES (?,?,?,?,?,?) (TransferFromIli.java:1476)
Info: readEnumValueMapFromDb(): SELECT iliCode,dispName,description,itfCode FROM agi_dmav_bodenbedeckung_v2.qualitaetsstandard (EnumValueMap.java:83)
Info: updateMultiEnumTable(): INSERT INTO agi_dmav_bodenbedeckung_v2.qualitaetsstandard (seq,iliCode,itfCode,dispName,inactive,description) VALUES (?,?,?,?,?,?) (TransferFromIli.java:1476)
Info: readEnumValueMapFromDb(): SELECT iliCode,dispName,description,itfCode FROM agi_dmav_bodenbedeckung_v2.darstellungin (EnumValueMap.java:83)
Info: updateMultiEnumTable(): INSERT INTO agi_dmav_bodenbedeckung_v2.darstellungin (seq,iliCode,itfCode,dispName,inactive,description) VALUES (?,?,?,?,?,?) (TransferFromIli.java:1476)
class ch.interlis.ili2c.metamodel.TypeAlias cannot be cast to class ch.interlis.ili2c.metamodel.AbstractEnumerationType (ch.interlis.ili2c.metamodel.TypeAlias and ch.interlis.ili2c.metamodel.AbstractEnumerationType are in unnamed module of loader 'app')
    ch.ehi.ili2db.fromili.TransferFromIli.updateMultiEnumTable(TransferFromIli.java:1466)
    ch.ehi.ili2db.fromili.TransferFromIli.updateEnumTable(TransferFromIli.java:1305)
    ch.ehi.ili2db.base.Ili2db.runSchemaImport(Ili2db.java:1599)
    ch.ehi.ili2db.base.Ili2db.run(Ili2db.java:258)
    ch.ehi.ili2db.AbstractMain.domain(AbstractMain.java:643)
    ch.ehi.ili2pg.PgMain.main(PgMain.java:76)

Mit --createEnumTabsWithId funktioniert es.

cc @olivergrimm @beistehen

patrickackermann commented 5 months ago

Attributes with a boolean domain are not handeled correctly.

This is a small Model that reproduces the exception:

INTERLIS 2.4;

MODEL BooleanTest AT "mailto:noreply@localhost" VERSION "2024-06-27" =
    DOMAIN BooleanDomain = BOOLEAN;

    TOPIC Topic = 
        CLASS Class = 
            AttrBoolean: BOOLEAN;
            AttrDomainBoolean: BooleanDomain;
        END Class;
    END Topic;
END BooleanTest.