Eclipse EMF: updating the Model

Now we will see how to handle a Model update.
Let’s say we want to add the “surname” attribute to Author entity.

Open the model diagram (Library.ecorediag) and add the new attribute

still of EString type

Save the changes (Ctrl-S), re-open file Library.genmodel, and re-generate the sources for the following plug-ins: Model, Edit and Editor (remember to click on each of the first three context-menu items)

Re-launch the application (doing a  Clean and checking the launch, in case of errors)

 

If you check the database now, you’ll find that table “author” has a new “surname” field, which the application can handle immediately

 

Back to index

 

This entry was tagged , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>