Setting all model classes to use AutoInc as PrimaryKeyMapper
No edit summary
m ((username removed) (log details removed): Moving to Documentation namespace)
(No difference)

Revision as of 20:48, 20 December 2023

Did you reverse a database and want to set all classes to use AutoInc for its primary key?

Here's an EAL for you:

Class.allInstances->select(c | c.TaggedValue->select(tv | tv.Tag='Eco.PrimaryKeyMapper')->isEmpty)
->collect(c |
let newtag = TaggedValue.Create in
(
    newtag.Tag := 'Eco.PrimaryKeyMapper';
    newtag.Value := 'AutoInc';
    newtag.ModelElement := c
  )
)
This page was edited 95 days ago on 02/10/2024. What links here