Setting all model classes to use AutoInc as PrimaryKeyMapper
(Created page with "Reversed a database and wanting to set all classes to use AutoInc for it's primary key? Here's an EAL for you; Class.allInstances->select(c | c.TaggedValue->select(tv | tv....")
 
No edit summary
Line 1: Line 1:
Reversed a database and wanting to set all classes to use AutoInc for it's primary key?
Reversed a database and wanted to set all classes to use AutoInc for its primary key?


Here's an EAL for you;
Here's an EAL for you;
Line 12: Line 12:
   )
   )
  )
  )
[[Category:EAL]]

Revision as of 09:47, 16 December 2022

Reversed a database and wanted 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 94 days ago on 02/10/2024. What links here