JPA « Database JDBC « Java Articles

Home
Java Articles
1.Build Deploy
2.Class
3.Core Library
4.Data Types
5.Database JDBC
6.Design
7.Development
8.File Input Output
9.Graphics Desktop
10.J2EE Enterprise
11.J2ME Wireless
12.JVM
13.Language
14.Library Product
15.Network
16.Security
17.SOA Web Services
18.Test
19.Web Development
20.XML
Java Articles » Database JDBC » JPA 

1. Understanding the Java Persistence API, Part 2: Relationships the JPA way    javaworld.com

Your Java applications are dependent on a web of data relationships, which can become a tangled mess if improperly handled. In this second half of her introduction to the Java Persistence API, Aditi Das shows you how JPA uses annotations to create a more transparent interface between object-oriented code and relational data. The resulting data relationships are easier to manage and more compatible with the object-oriented programming paradigm.

2. Understanding the Java Persistence API, Part 1    javaworld.com

Numerous projects have sought to make the data persistence layer a good object-oriented citizen in Java application development. The Java Persistence API, an outgrowth of JSR 220, collects and standardizes that work. In this first half of a two-part introduction to the Java Persistence API, learn how JPA tames the process of writing code that manipulates data, making it a more natural piece of your object-oriented architecture.

3. Standardizing Java Persistence with the EJB3 Java Persistence API    onjava.com

Although there are several options for building the persistence tier of applications, there is no single persistence standard for the Java platform that can be used in both the Java EE and Java SE environments. The good news is that the EJB3 Java Persistence API (JPA), which is part of the EJB 3.0 spec (JSR-220), standardizes persistence API for the Java platform. JSR-220 was widely received by O-R mapping vendors such as TopLink and Hibernate, as well as other leading application server vendors and JDO vendors. The EJB3 specification offers a compelling option for building the persistence tier of enterprise Java applications.

4. JPA 101 Java Persistence Explained    theserverside.com

JPA 101: Java Persistence Explained is a fundamentals guide to the ins and outs of JPA, the Java object/relational mapping and persistence standard for both Java SE and Java EE applications. The book covers the basics of working with the JPA, JPA annotations, Entity Manager, JPA Query Language, and tools.

5. Defining Your Object Model with JPA    theserverside.com

JPA provides three different types of queries, dynamic queries, static or named queries, and native queries. Dynamic and static queries use the Java Persistence Query Language and native queries use SQL. A dynamic query is one that is processed at runtime, meaning it is parsed and SQL generated every time it?s created. Static queries are processed when the persistence provider loads your object model. This means static queries are parsed once and reused every time you run the query.

6. Java Feature — Inheritance Hierarchies in JPA | JAVA Developer's Journal    java.sys-con.com

The persistence model introduced in EJB 3.0 as a replacement for entity beans is known as the Java Persistence API (JPA). The JPA borrows from both proprietary and open source models, such as Oracle TopLink, Hibernate, Spring, and other frameworks, which have gained traction as popular alternatives to the often heavyweight and cumbersome persistence directives required by earlier EJB revisions. Among the new features introduced in EJB 3.0 through the JPA is support for entity inheritance. In this article, we will examine inheritance strategies supported by the JPA and apply these strategies to a simple entity hierarchy, exploring the strengths and weaknesses of each approach. This comparison is intended to help you understand how to set up entity hierarchies, and to decide which mapping approach to take for the entity hierarchies in your own application.

7. Master the New Persistence Paradigm with JPA    devx.com

The code above shows you the minimum required to define a persistent object. Let's now manipulate this object. I want to persist my customer, update some of its attributes, and delete it from the database. These CRUD operations are made through the javax.persistence.EntityManager interface of JPA. For those of you who are familiar with the DAO pattern, the EntityManager can be seen as a DAO class providing you with a set of life cycle methods (persist, remove) and finders (find) (see Listing 1).

8. Persistence Pays Offs: Advanced Mapping with JPA    devx.com

Customers have a home address but Watermelon also needs to define a set of delivery addresses. Each of these addresses can be used on the weekend or/and in the evenings. I will implement this information by adding tags to an address. To do all this I will use one-to-many and many-to-many relationships with JPA. Figure 1 shows the business model to implement.

9. Java Persistence API FAQ    java.sun.com

A: We introduced the Java Persistence API to the Java platform for two reasons. First, this new API simplifies the development of Java EE and Java SE applications using data persistence. Second, we wanted to get the entire Java community behind a single, standard persistence API.

10. Comment lines: Roland Barcia: How useful are annotated named queries in the Java Persistence API, really?    ibm.com

The Java Persistence API (JPA) defines several ways to access data: either through the entity manager, through JPA-QL, or through native queries. JPA makes use of annotations as a mechanism to map Java objects to the underlying database. You can also provide XML metadata as an overriding or alternative mechanism to the mapped annotations. However, most JPA usage I have seen out there has clearly favored the use of annotations. The fact that the specification documentation presents all of its examples using annotations and no examples of XML-based mapping samples (it only shows you an XML Schema) is likely one of the overriding reasons this is so. Object Relational Mapping was created to abstract details of the underlying database from the Java object model. However, JPA may be letting database details quickly creep back into the Java source. In this commentary, I will examine the various query styles in JPA, rationalize why they exist, and explain why certain styles (such as named queries) just make no sense to be annotated. I will conclude by showing that this small example is really part of a much larger problem.

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.