// Product of Store
Product product = new Product(productName,"A",100.0,1, publicationDate);
pm.makePersistent(product);
// Store instances
Store store = new Store();
store.getProducts().add(product);
store.getProductsByName().put(productName, product);
pm.makePersistent(store);
}
tx.commit();
} finally {
if (tx.isActive()) {