| Free tutorials for Java, Eclipse and Web programming |
Version 0.3
Copyright © 2007-2011 Lars Vogel
30.01.2011
| Revision History | ||
|---|---|---|
| Revision 0.1 | 20.01.2010 | Lars Vogel |
| split from main EMF article into own article | ||
| Revision 0.2 - 0.3 | 01.03.2010 - 30.01.2011 | Lars Vogel |
| bug fixes and enhancements | ||
Table of Contents
EMF allows to store the model content via the EMF persistence framework. EMF provides XMI and XML persistence provider. By default EMF uses XMI (XML Metadata Interchange). XMI is a standard for exchanging metadata information via Extensible Markup Language (XML).
The following demonstrates how you create a EMF model instance, save it and load it again.
If you persistent an EMF object all dependent object will automatically be persistent. Objects which do not have a "contains relationship" must be added explicitly to the resource.getContents().add(). If objects are not added and not included in a contains relationship an exception is thrown when calling resource.save()
This article focus on the persistence of EMF models via XMI. For an introduction into Eclipse EMF please see Eclipse EMF .