Java Reference
In-Depth Information
edition.setId(1022009);
edition.setEdition("January/February 2009");
em.persist(edition);
em.flush();
em.merge(catalog1);
catalog1.addEdition(edition);
Section features = new Section();
features.setId("Oracle_Mag_Features_022009");
features.setSectionName("FEATURES");
em.persist(features);
em.merge(edition);
edition.addSection(features);
Also, create an article to the features section:
Article article = new Article(features);
article.setId(12009);
article.setTitle("Launching Performance");
em.persist(article);
em.merge(features);
features.addArticle(article);
em.flush();
article = new Article(features);
article.setId(22009);
article.setTitle("Building on a Solid Foundation");
em.persist(article);
features.addArticle(article);
em.flush();
Add an article to the technology section:
Section technology = new Section();
technology.setId("Oracle_Mag_Tech_022009");
technology.setSectionName("Technology");
em.persist(technology);
em.merge(edition);
edition.addSection(technology);
article = new Article(technology);
article.setId(32009);
article.setTitle("On Dynamic Sampling");
em.persist(article);
em.merge(technology);
technology.addArticle(article);
em.flush();
 
Search WWH ::




Custom Search