persistence-manager

Cant inject EntityManager With @PersistenceContext in most basic example

你。 提交于 2020-01-05 08:59:10
问题 To test JPA with PersistenceContext injection of entity manager I have basic example project with following structure: Person entity: @Entity public class Person { @Id @GeneratedValue private long id; private String name; private String surname; public Person() { } public Person(String name, String surname) { this.name = name; this.surname = surname; } public long getId() { return id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public

How to use JDO persistence manager?

只愿长相守 提交于 2019-11-27 14:51:49
I have two questions regarding how to create / use the JDO persistence manager (PM, hereafter). Say, in a Java web application, if I have 10 entities, which can be logically grouped into 2 groups (for example, 5 user related entities and 5 business related entities) Should I need two different PMs to manage these 2 groups or only one PM is enough? Regarding the initialization, shall I use singleton instance of a PM (which will be shared by all the user's using the app at a given point of time) or should I create a PM for each and every session? NamshubWriter According to the JDO Documentation

How to use JDO persistence manager?

北城以北 提交于 2019-11-26 18:27:25
问题 I have two questions regarding how to create / use the JDO persistence manager (PM, hereafter). Say, in a Java web application, if I have 10 entities, which can be logically grouped into 2 groups (for example, 5 user related entities and 5 business related entities) Should I need two different PMs to manage these 2 groups or only one PM is enough? Regarding the initialization, shall I use singleton instance of a PM (which will be shared by all the user's using the app at a given point of time