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

Architecture

The Java persistence API is built around the following components:

  • Persistence provider: A persistence provider is a JPA implementation provided by a vendor. As with most Java APIs, JPA is a standard API, where a set of different actual implementations are available from different vendors. The persistence provider means the vendor of the actual implementation we are using.
  • Entities: An entity is a class that represents a domain object in our enterprise application. From a JPA perspective, an entity is represented with a table in the database, and an instance of this entity represents a record in that table.
  • Entity managers: An entity manager is an object that represents a connection to a database, and contains all methods for the different operations that can be performed with the database, such as inserting a new record, retrieving a single record, performing advanced queries, and so on.
  • Entity transaction: An entity transaction represents a database transaction that can be either committed or rolled back according to the application state. Any update operations (insert, update, delete) should be performed within the boundaries of an entity transaction.
  • Query: As the name suggests, a query is an object that is used to perform a database query! In addition to the regular SQL, JPA provides a custom query language (called JPQL) that can be used to perform queries exactly like SQL, but with object-oriented concepts.
  • Persistence unit: A persistence unit is a group of entities involved in a persistence context. A persistence unit is specified using a configuration file (persistence.xml), describing connection information, entities involved, and other useful configurations.
主站蜘蛛池模板: 乡城县| 韶山市| 沁阳市| 沈阳市| 南华县| 株洲市| 从化市| 涟源市| 婺源县| 通化市| 静海县| 双桥区| 文昌市| 东阿县| 杨浦区| 蓝田县| 台湾省| 余姚市| 安远县| 平江县| 勐海县| 治县。| 昭通市| 新昌县| 驻马店市| 湟源县| 华池县| 仁布县| 开原市| 纳雍县| 凤阳县| 友谊县| 民乐县| 浦东新区| 韶山市| 灌南县| 沈阳市| 泰州市| 遂宁市| 延寿县| 安新县|