- EJB 3 Developer Guide
- Michael Sikora
- 292字
- 2021-07-02 11:34:54
Introduction
Entities are classes that need to be persisted; their state is stored outside the application, typically in a relational database. Unlike session beans, entities do not have business logic other than validation. As well as storing such entities, we want to query, update, and delete them.
The EJB 3 specification recognizes that many applications have the above persistence needs without requiring the services (security, transactions) of an application server EJB container. Consequently the persistence aspects of EJB 3 have been packaged as a separate specification—the Java Persistence API (JPA). JPA does not assume we have a container and can even be used in a Java SE (Standard Edition) application. As well as persistence, JPA deals with Object/Relational Mapping and Queries, these are covered in Chapters 4 and 5 respectively. Most of our examples assume that the persistence engine exists within an EJB 3 container such as GlassFish or JBoss. In Chapter 6 we shall show examples of persistence outside a container.
Successful standalone object-relational mapping products such as open source Hibernate and proprietary Oracle Toplink have implemented these persistence technologies for a number of years. Creators of Oracle Toplink and Hibernate have been influential in the development of the JPA specification. So, readers who are familiar with either Hibernate or Toplink will recognize similarities between the JPA and those products. Furthermore, under the covers, the GlassFish application server implements the JPA using Toplink and the JBoss application server uses Hibernate. These are pluggable defaults however, so it is possible to implement the JPA in GlassFish using Hibernate for example.
The JPA can be regarded as a higher level of abstraction sitting on top of JDBC. Under the covers the persistence engine converts JPA statements into lower level JDBC statements.
- Adobe創意大學After Effects CS5 產品專家認證標準教材
- 四時風月繪:國風水墨CG插畫繪畫技法
- MySQL Admin Cookbook LITE: Configuration, Server Monitoring, Managing Users
- Blender 3D 2.49 Architecture, Buidlings, and Scenery
- Plone 3 Multimedia
- Photoshop CS6實戰基礎培訓教程(全視頻微課版)
- CorelDRAW 2020中文版入門、精通與實戰
- 中文版3ds Max/VRay效果圖制作完全自學教程(實例培訓教材版)
- AutoCAD 2022中文版完全自學一本通
- Origin 2022科學繪圖與數據分析
- 企業虛擬化實戰:VMware篇
- Quality Assurance for Dynamics AX-Based ERP Solutions
- Python 3 Web Development Beginner's Guide
- Maya 2015從入門到精通
- Apache Solr High Performance