02.12.2009Infopoint - Java EE 5 - Jörg Wüthrich21 / 24 Persistenz Java EE 5 Speichern Query public class PersonDbServiceBean implements PersonDbService { @javax.persistence.PersistenceContext private EntityManager em; public int addPerson(Person person) { em.persist(person); return person.getId(); } public List getPersonList() { Query query = em.createQuery( SELECT p FROM Person p ); List result = query.getResultList(); return result; }
{}