Java Reference
In-Depth Information
developer.setId("Oracle_Mag_Dev_042009");
developer.setSectionName("Developer");
em.persist(developer);
em.merge(edition);
edition.addSection(developer);
Add an article to the developer section:
article = new Article(developer);
article.setId(112009);
article.setTitle("The Next-Generation Data Center");
em.persist(article);
em.merge(developer);
developer.addArticle(article);
em.flush();
Add another article to the developer section:
article = new Article(developer);
article.setId(122009);
article.setTitle("On Avoiding Termination");
em.persist(article);
developer.addArticle(article);
em.flush();
Create a catalog for the MSDN Magazine:
Catalog catalog2 = new Catalog();
catalog2.setJournal("MSDN Magazine");
em.persist(catalog2);
em.flush();
edition = new Edition();
edition .setId(62009);
edition.setEdition("June 2009");
em.persist(edition);
Section msdn_features = new Section();
msdn_features.setId("MSDN_Mag_Features_062009");
msdn_features.setSectionName("FEATURES");
em.persist(msdn_features);
em.merge(edition);
edition.addSection(msdn_features);
Add an article to the features section:
article = new Article(msdn_features);
article.setId(6012009);
 
Search WWH ::




Custom Search