The Java Persistence API, sometimes referred to as JPA, is a Java programming language framework managing relational data in applications using Java Platform, Standard Edition and Java Platform, Enterprise Edition.
The Java Persistence API originated as part of the work of the JSR 220 Expert Group. JPA 2.0 is the work of the JSR 317 Expert Group.
Persistence in this context covers three areas:
- the API itself, defined in the
javax.persistence
package - the Java Persistence Query Language (JPQL)
- object/relational metadata
Contents[hide] |
[edit]History
The final release date of the JPA 1.0 specification was 11 May 2006 as part of JSR 220. The JPA 2.0 specification was released 10 Dec, 2009.
[edit]Entities
A persistence entity is a lightweight Java class whose state is typically persisted to a table in a relational database. Instances of such an entity correspond to individual rows in the table. Entities typically have relationships with other entities, and these relationships are expressed through object/relational metadata. Object/relational metadata can be specified directly in the entity class file by using annotations, or in a separate XML descriptor file distributed with the application.
[edit]The Java Persistence Query Language
The Java Persistence Query Language (JPQL) makes queries against entities stored in a relational database. Queries resemble SQL queries in syntax, but operate against entity objects rather than directly with database tables.
[edit]Motivation for creating the Java Persistence API
Many enterprise Java developers use lightweight persistent objects provided by open-source frameworks or data access objects instead of entity beans: entity beans and enterprise beans had a reputation of being too heavyweight and complicated[clarify], and one could only use them in Java EE application servers. Many of the features of the third-party persistence frameworks were incorporated into the Java Persistence API, and, as of 2006, projects like Hibernate (version 3.2) and TopLink Essentials have become implementations of the Java Persistence API.
[edit]Related Technologies
[edit]Enterprise JavaBeans
The EJB 3.0 specification (itself part of the Java EE 5 platform) included a definition of the Java Persistence API. However, end-users do not need an EJB container or a Java EE application server in order to run applications that use this persistence API.[1] Future versions of the Java Persistence API will be defined in a separate JSR and specification rather than in the EJB JSR/specification.
The Java Persistence API replaces the persistence solution of EJB 2.0 CMP (Container Managed Persistence).
[edit]Java Data Objects API
The Java Persistence API was developed in part to unify the Java Data Objects API, and the EJB 2.0 Container Managed Persistence (CMP) API. As of 2009 most products supporting each of those APIs support the Java Persistence API.
The Java Persistence API specifies persistence only for relational database management systems. That is, JPA focuses on object-relational mapping (ORM) (yet, there are JPA providers who support other database models besides relational database).
The Java Data Objects specification supports ORM, as well as persistence to other types of database models, for example flat file databases.
[edit]Service Data Object API
The designers[2] of the Java Persistence API aimed to provide for relational persistence, with many of the key areas taken from object-relational mapping tools such as Hibernate and TopLink. Java Persistence API improved on and replaced EJB 2.0, evidenced by its inclusion in EJB 3.0. The Service Data Objects (SDO) API (JSR 235) has a very different objective to the Java Persistence API and is considered [3][4] complementary. The SDO API is designed for service-oriented architectures, multiple data formats rather than only relational data, and multiple programming languages. The Java Community Process manages the Java version of the SDO API; the C++ version of the SDO API is managed via OASIS.
[edit]Hibernate
Hibernate provides an open source object-relational mapping framework for Java. Versions 3.2 and later provide an implementation for the Java Persistence API.[5]
Gavin King founded[6] Hibernate. He represented JBoss on JSR 220,[7] the JCP expert group charged with developing JPA. This led to ongoing controversy and speculation surrounding the relationship between JPA and Hibernate. Sun Microsystems has stated[8] that ideas came from several frameworks, including Hibernate and JDO.
[edit]JPA 2.0
Development of a new version of JPA, namely JPA 2.0 JSR 317 was started in July 2007. JPA 2.0 was approved as final on December 10, 2009.
The focus of JPA 2.0 was to address features that were present in some of the popular ORM vendors but couldn't gain consensus approval for JPA 1.0.
The main features included in this update are:
- Expanded object-relational mapping functionality
- support for collections of embedded objects[clarify]
- multiple levels of embedded objects
- ordered lists
- combinations of access types
- A criteria query API
- standardization of query 'hints'[clarify]
- standardization of additional metadata to support DDL generation
- support for validation
Vendors supporting JPA 2.0
- BatooJPA
- DataNucleus (formerly JPOX)
- EclipseLink (formerly Oracle TopLink)
- JBoss Hibernate
- ObjectDB
- OpenJPA
- IBM, via its OpenJPA-based Feature Pack for OSGi Applications and JPA 2.0 for WebSphere Application Server
- Versant JPA (not relational, object database)
[edit]See also
[edit]References
- ^ Hibernate EntityManager: Java SE environments
Hibernate EntityManager: Obtaining an EntityManager in a Java SE environment - ^ "JSR 220 Members".
- ^ Barreto, Charlton. "SDO and JPA". Digital Walkabout. Retrieved 5 May 2011.
- ^ Edwards, Mike. "SDO and Java Persistence Architecture (JPA)". Open SOA. osoa.org. Retrieved 5 May 2011.
- ^ "hibernate.org - Java Persistence with Hibernate". JBoss. Retrieved 2008-11-17. "Hibernate implements the Java Persistence object/relational mapping and persistence management interfaces"
- ^ "Manning: Java Persistence with Hibernate". Manning. "Gavin King -- the founder of the Hibernate project"
- ^ "JBoss.com - Industry Leadership". JBoss. Retrieved 2008-11-17. "JSR 220, EJB 3.0 Spec Committee, Gavin King, Bill Burke, Marc Fleury"
- ^ "Java Persistence API FAQ". Sun Microsystems. Archived from the original on 2008-08-22. Retrieved 2010-07-01. "The Java Persistence API draws upon the best ideas from persistence technologies such as Hibernate, TopLink, and JDO"
[edit]External links
Wikibooks has a book on the topic of: Java Persistence |
[edit]General info
- JCP Persistence page
- GlassFish's Persistence page
- Documentation for the final version of the EJB3 spec (called JSR220)
[edit]Documentation
[edit]Tutorials
- Java EE 6 Persistence API tutorial
- Java EE 6 Persistence API Javadoc
- Hibernate EntityManager User guide
- Hibernate Javadoc: org.hibernate.ejb
- EclipseLink JPA tutorials for Application Servers
- DataNucleus JPA tutorial for RDBMS
- Versant JPA Getting Started Tutorial
- http://jpa-quiz.rhcloud.com/
출처 - http://en.wikipedia.org/wiki/Java_Persistence_API
In computing, TopLink is an object-relational mapping (ORM) package for Java developers. It provides a framework for storing Java objects in a relational database or for converting Java objects to XML documents.
TopLink Essentials [1] is a reference implementation of the EJB 3.0 Java Persistence API (JPA) and a product of Oracle.
Contents[hide] |
[edit]History
The Object People (that's the "Top" in the Name) originally developed TopLink in Smalltalk in the 1990s. In 1996-1998 a Java version of the product was created named "TopLink for Java". After the joint acquisition of The Object People in April 2000 by BEA Systems and WebGain, the TopLink product-line became the property of WebGain[2]
In 2002 Oracle Corporation acquired TopLink, which continues to be developed in the Oracle Fusion Middleware product.
In 2006, Oracle donated source code from the TopLink product and development resources to the open-source Sun Microsystems java.net GlassFish project. It became the Java EE EJB 3.0 JPA reference implementation.
In 2007, TopLink source code was donated to the Eclipse Foundation and the EclipseLink project was born.[3]
In March 2008 the Eclipse Foundation announced that Sun Microsystems had selected the EclipseLink project as the reference implementation for the JPA 2.0, JSR 317 standard. [4]
[edit]Features
As well as functioning as an object-relational mapping tool, TopLink has other features including:
- query framework that supports an object-oriented expression framework, Query by Example (QBE), EJB QL, SQL, and stored procedures
- an object-level transaction framework
- caching to ensure object identity
- a set of direct and relational mappings
- object-to-XML mappings, in addition to JAXB support
- EIS/JCA support for non-relational datasources
- visual mapping editor (Mapping Workbench)
- limited support for query in memory
[edit]Awards
- 4th-best Java persistence architecture (as voted by Java Developer's Journalreaders in 2004).[7]
[edit]See also
[edit]References
- ^ TopLink
- ^ A Brief History of TopLink by Donald Smith
- ^ "Oracle Proposes Open Source Persistence Project at Eclipse Foundation". Oracle. March 6, 2008. Retrieved 2008-09-16.
- ^ "Eclipse Announces EclipseLink Project to Deliver JPA 2.0 Reference Implementation". Eclipse Foundation. March 17, 2008. Retrieved 2008-09-16.
- ^ Best Java Data Access Tool or Driver by Java Pro
- ^ Best Java Data Access Tool by JavaWorld
- ^ 4th best Java persistence architecture by Java Developer's Journal
[edit]External links
- Oracle TopLink Official Home
- Oracle TopLink Quick Tour
- Oracle TopLink Forum
- Oracle TopLink Wiki
- TopLink Essentials Home
- TopLink Essentials Mailing List
- Unofficial TopLink Wiki
- Master the New Persistence Paradigm with JPA
출처 - http://en.wikipedia.org/wiki/TopLink
'DB > ORM' 카테고리의 다른 글
jpa primary key(id) composite(기본키 복수 지정) (0) | 2013.03.12 |
---|---|
JPA에 대한 소개, 활용방안, Spring 프레임워크와 통합 (0) | 2013.01.05 |
Entity와 Value Object 그리고 Service (0) | 2013.01.04 |
도메인의 퍼시스턴스 계층을 담당할 Repository의 탄생(DAO vs REPOSITORY) (0) | 2013.01.04 |
JPA 2.0의 형식이 안전한 동적 쿼리 (0) | 2013.01.02 |