em = emf.createEntityManager();
// An entity with a numeric system ID and no ancestors.
// System ID is not assigned until the EntityManager is
// closed in the finally block.
BookNumericId book2 = new BookNumericId();
em.persist(book2);
} finally {
em.close();
}