Setting all model classes to use AutoInc as PrimaryKeyMapper
(Automatically adding template at the end of the page.)
(Replacing message template with parser tag)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<message>Write the content here to display this box</message>
Did you reverse a database and want to set all classes to use AutoInc for its primary key?
Did you reverse a database and want to set all classes to use AutoInc for its primary key?



Latest revision as of 07:56, 17 June 2024

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 06/17/2024. What links here