package pt.ist.fenixframework.example.tpcw.domain; valueType java.sql.Date as DateValueType { externalizeWith { long getTime(); } } valueType java.sql.Timestamp as TimestampValueType { externalizeWith { long getTime(); } } class Author { String fname; String lname; String mname; DateValueType dob; String bio; int a_id; // not really needed. Maintained only for compatibility with the TPCW implementation. } class Book { String title; DateValueType pubDate; String publisher; String subject; String description; // int related1; // int related2; // int related3; // int related4; // int related5; String thumbnail; String image; double srp; double cost; DateValueType avail; int stock; String isbn; int page; String backing; String dimensions; int i_id; // not really needed. Maintained only for compatibility with the TPCW implementation. } relation BookHasAuthor { Book playsRole books { multiplicity *; } Author playsRole author; } // Discuss this solution versus a set of 5 related books relation BookHasRelatedBook1 { Book playsRole relatedTo1; Book playsRole relatedFrom1 { multiplicity *; } } relation BookHasRelatedBook2 { Book playsRole relatedTo2; Book playsRole relatedFrom2 { multiplicity *; } } relation BookHasRelatedBook3 { Book playsRole relatedTo3; Book playsRole relatedFrom3 { multiplicity *; } } relation BookHasRelatedBook4 { Book playsRole relatedTo4; Book playsRole relatedFrom4 { multiplicity *; } } relation BookHasRelatedBook5 { Book playsRole relatedTo5; Book playsRole relatedFrom5 { multiplicity *; } } class Country { String name; double currency; String exchange; int co_id; // not really needed. Maintained only for compatibility with the TPCW implementation. } class Address { String street1; String street2; String city; String state; String zip; int addr_id; // not really needed. Maintained only for compatibility with the TPCW implementation. } relation AddressHasCountry { Country playsRole country; Address playsRole addresses { multiplicity *; } } class Customer { String uname; String passwd; String lname; String fname; String phone; String email; DateValueType since; DateValueType lastLogin; TimestampValueType login; TimestampValueType expiration; double discount; double balance; double ytd_pmt; DateValueType birthdate; String data; int c_id; // not really needed. Maintained only for compatibility with the TPCW implementation. } relation CustomerHasAddress { Address playsRole address; Customer playsRole customers { multiplicity *; } } class Orders { TimestampValueType date; double subtotal; double tax; double total; String shipType; TimestampValueType shipDate; String status; int o_id; // not really needed. Maintained only for compatibility with the TPCW implementation. } relation OrdersHasAddress { Address playsRole billAddress; Orders playsRole billOrders { multiplicity *; } } relation OrdersHasShipAddress { Address playsRole shipAddress; Orders playsRole shipOrders { multiplicity *; } } relation OrdersHasCustomer { Customer playsRole customer; Orders playsRole orders { multiplicity *; } } class OrderLine { int qty; double discount; String comments; int ol_id; // not really needed. Maintained only for compatibility with the TPCW implementation. } relation OrdersHasOrderLines { Orders playsRole order; OrderLine playsRole orderLines { multiplicity *; } } relation OrderLineHasBook { Book playsRole book; OrderLine playsRole orderLines { multiplicity *; } } class CCXact { String type; long num; String name; DateValueType expiry; // String authId; double total; TimestampValueType shipDate; int cx_o_id; // not really needed. Maintained only for compatibility with the TPCW implementation. } relation CCXactHasCountry { Country playsRole country; CCXact playsRole ccXacts { multiplicity *; } } relation CCXactHasOrders { Orders playsRole order; CCXact playsRole ccXact; } class ShoppingCart { int sc_id; TimestampValueType time; } class ShoppingCartLine { Integer qty; } relation ShoppingCartLineHasShoppingCart { ShoppingCart playsRole shoppingCart; ShoppingCartLine playsRole shoppingCartLines { multiplicity *; } } relation ShoppingCartLineHasBook { Book playsRole book; ShoppingCartLine playsRole shoppingCartLines { multiplicity *; } } // This is the root domain object class Root { boolean loaded; // auxiliary slot for the bootstrap sequence Integer numOrderIds; // for the generation of order ids Integer numCartIds; // for the generation of shopping cart ids Integer numAddrIds; // for the generation of address ids Integer numCustomerIds; // for the generation of customer ids } relation RootHasCustomers { Root playsRole root; Customer playsRole customers { multiplicity *; } } relation RootHasBooks { Root playsRole root; Book playsRole books { multiplicity *; } } relation RootHasAuthors { Root playsRole root; Author playsRole authors { multiplicity *; } } relation RootHasShoppingCarts { Root playsRole root; ShoppingCart playsRole shoppingCarts { multiplicity *; } } relation RootHasOrderss { // the double ss is caused by the original name, Orders Root playsRole root; Orders playsRole orderss { multiplicity *; } } relation RootHasCountries { Root playsRole root; Country playsRole countries { multiplicity *; } }