官术网_书友最值得收藏!

  • EJB 3 Developer Guide
  • Michael Sikora
  • 188字
  • 2021-07-02 11:34:56

Summary

Entities are classes that need to be persisted, usually in a relational database. The persistence aspects of EJB 3 have been packaged as a separate specification, the Java Persistence API (JPA), so that applications that do not need EJB container services can still persist their entities to a relational database. Persistence services are handled by a persistence engine. In this chapter we make use of the Toplink persistence engine that comes bundled with the GlassFish application server.

Any Java class, or POJO, can be converted to an entity using metadata annotations. We described by means of an example the default rules for mapping an entity to a relational database table.

We introduced the EntityManager service, which provides methods for persisting, finding, querying, removing and updating entities. We saw examples of the EntityManager.persist() and EntityManager.find() methods. We introduced the concept of a persistence context, which is the set of managed entity instances.

We looked at Ant scripts for packaging and deploying an application which uses entities.

We examined strategies for generating primary keys. Finally we looked at examples of overriding default rules for mapping entities to relational tables.

主站蜘蛛池模板: 禄劝| 五家渠市| 缙云县| 义乌市| 沛县| 西林县| 濮阳县| 西充县| 封丘县| 曲阳县| 唐海县| 万源市| 盐边县| 莲花县| 富平县| 北流市| 上杭县| 高淳县| 咸宁市| 蓬溪县| 金塔县| 得荣县| 石首市| 佛冈县| 水城县| 修武县| 斗六市| 新津县| 礼泉县| 建德市| 定日县| 唐河县| 周至县| 拉孜县| 响水县| 丘北县| 十堰市| 莱芜市| 田东县| 乐至县| 东明县|