post.setType(PostType.NEWS);
postDao.persist(post);
postDao.getEntityManager().getTransaction().commit();
postDao.setEntityManager(factory.createEntityManager());
System.out.println(postDao.retrieve(post.getId()).getContent());
System.out.println(postDao.retrieve(1).getPreview());
}
public void testB() throws Exception {
ApplicationContext context = new ClassPathXmlApplicationContext("/config.xml");
PostService postService = (PostService) context.getBean("postService");