1: doctype "../grammars/EcoreJava.g.etl";
2:
3: annotation_source ecore = "http://eclipse.org/emf/ecore";
4:
5: @[ecore(basePackage="org.eclipse.example",
6: "nsUri"="http://www.eclipse.org/emf/example/lib",
7: nsPrefix="lib")]
8: package Library {
9:
10: datatype JavaDate {
11: java_class java.util.Date;
12: };
13:
14: class Library {
15: var name : String;
16: var composite writers : Writer [ 0 .. * ];
17: var composite books : Book [ 0 .. * ];
18: };
19:
20: class Book {
21: var title : String;
22: var pages : int = 100;
23: var category : BookCategory;
24: var author : Writer inverseof books;
25: var publicationDate : JavaDate;
26: };
27:
28: class Writer {
29: var name : String;
30: var books : Book [ 0 .. * ] inverseof author;
31: };
32:
33: enumeration BookCategory {
34: literal Mystery;
35: literal ScienceFiction;
36: literal Biography;
37: };
38: };