- 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.
- 數(shù)據(jù)、模型與決策:基于Excel的建模和商務(wù)應(yīng)用
- 中文版3ds Max 2016/VRay效果圖制作實(shí)戰(zhàn)基礎(chǔ)教程
- Moldflow 2010完全自學(xué)與速查手冊(模流分析·成本控制)
- 剪映:短視頻剪輯/字幕/動(dòng)畫/AI從新手到高手(手機(jī)版+電腦版)
- ASP.NET 3.5 Application Architecture and Design
- 中文版Photoshop CS6全能修煉圣經(jīng)(移動(dòng)學(xué)習(xí)版)
- 中文版Photoshop CS6從新手到高手(超值版)
- Elasticsearch數(shù)據(jù)搜索與分析實(shí)戰(zhàn)
- 用Multisim玩轉(zhuǎn)電路仿真
- AI繪畫與攝影實(shí)戰(zhàn)108招:ChatGPT+Midjourney+文心一格
- PKPM 2010結(jié)構(gòu)分析從入門到精通
- CINEMA 4D新手快速進(jìn)階實(shí)例教學(xué)
- 深度學(xué)習(xí)之圖像識(shí)別:核心技術(shù)與案例實(shí)戰(zhàn)
- Grails 1.1 Web Application Development
- 中文版After Effects 2020基礎(chǔ)教程