- 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.
- Sakai CLE Courseware Management
- 數(shù)據(jù)、模型與決策:基于Excel的建模和商務(wù)應(yīng)用
- Excel圖表與表格實(shí)戰(zhàn)技巧精粹
- Beginning Swift
- Word論文排版之道
- Python 2.6 Graphics Cookbook
- CorelDRAW X5實(shí)用教程(第2版)
- Blender 3D Architecture, Buildings, and Scenery
- 中文版Photoshop CS6全能一本通·全彩版
- 學(xué)摳圖:Photoshop專業(yè)摳圖技法案例教程
- 中文版After Effects 2022基礎(chǔ)教程
- Adobe創(chuàng)意大學(xué)Photoshop產(chǎn)品專家認(rèn)證標(biāo)準(zhǔn)教材(CS6修訂版)
- IBM WebSphere eXtreme Scale 6
- Photoshop數(shù)字圖像處理
- MooTools 1.2 Beginner's Guide