aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes EJB 3: JPA versus Beginning EJB 3 App Dev Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB 3: JPA versus Beginning EJB 3 App Dev" Watch "EJB 3: JPA versus Beginning EJB 3 App Dev" New topic
Author

EJB 3: JPA versus Beginning EJB 3 App Dev

Ko Ko Naing
Ranch Hand

Joined: Jun 08, 2002
Posts: 3178
Raghu Kodali and Jonathan Wetherbee,
I've learnt that EJB 3: JPA covers mainly about the JPA. Could you please shed us some light on how your book covers JPA in particular?

Thanks


Co-author of SCMAD Exam Guide, Author of JMADPlus
SCJP1.2, CCNA, SCWCD1.4, SCBCD1.3, SCMAD1.0, SCJA1.0, SCJP6.0
Jon Wetherbee
author
Ranch Hand

Joined: Oct 05, 2006
Posts: 33
Hi Ko Ko-
Yes, the book you cite, Pro EJB 3: Java Persistence API, covers the entire JPA, in depth. Our book, Beginning EJB 3 Application Development: From Novice to Professional, covers all of EJB 3, including the JPA, but does not go into as much detail. We have two chapters specifically on JPA.

From the How This Book Is Organized section in Chapter 1, here are summaries of these chapters:

Chapter 3: Entities and the Java Persistence API

The new Java Persistence API (JPA) is introduced, along with the various persistence services that are available to support entities both within a Java EE container and outside of one. This chapter covers basic O/R mappings and introduces the Java Persistence Query Language, or JPQL.

Chapter 4: Advanced Persistence Features

Delving into more advanced persistence concepts, this chapter describes the new support offered in the JPA for mapping entity inheritance hierarchies. Examples of the three supported inheritance mapping strategies identify the strengths and weaknesses of each approach, to help you decide which one best suits the particular needs of your application. This chapter also covers the ID (primary key) generators introduced in the JPA, for autopopulating ID values using a database sequence or table.

In addition, chapters on deployment, migration, and performance cover issues relating to the JPA. We also define an end-to-end application that demonstrats the use of JPA entities in the context of a complete Java EE 5 application.

Also, from the Table of Contents, here are the (condensed) outlines of Chapters 3 and 4:

CHAPTER 3 Entities and the Java Persistence API
An Entity Example
A Simple JavaBean: Customer.java
A Simple Entity: Customer.java
An Entity with Defaults Exposed: Customer.java
Coding Requirements
Example: Annotating Instance Variables
Example: Annotating Property Accessors
Declaring the Primary Key
Simple Primary Key
Composite Primary Key
Summary of Entity Examples
The Persistence Archive
The persistence.xml File
The EntityManager
Persistence Context
Acquiring an EntityManager Instance
Transaction Support
The Entity Life Cycle
The Life Cycle of a New Entity Instance
O/R Mapping
The @Table Annotation (Revisited)
The @Column Annotation (Revisited)
Complex Mappings
Entity Relationships
@OneToOne
@OneToMany and @ManyToOne
@ManyToMany
Lazy vs. Eager Field Bindings
Cascading Operations
JPQL
@NamedQuery and @NamedQueries
Binding Query Parameters
Dynamic Queries
Bulk Update and Delete Operations
Complex Queries
Forward Generation vs. Reverse Engineering
Forward Generation == Persistence
Reverse Engineering == Adaption
Which One Is Right for Your Project?
Example Application: CustomerOrderManager
Customer.java
CustomerOrder.java
Address.java
CustomerOrderManager.java
CustomerOrderClient.java
persistence.xml
Conclusion

CHAPTER 4 Advanced Persistence Features
Mapping Entity Inheritance Hierarchies
Getting Started
Entity Inheritance Mapping Strategies
Single-Table-per-Class Inheritance Hierarchy
(InheritanceType.SINGLE_TABLE)
Common Base Table with Joined Subclass Tables
(InheritanceType.JOINED)
Single-Table-per-Outermost Concrete Entity Class
(InheritanceType.TABLE_PER_CLASS)
Comparison of O/R Implementation Approaches
Using Abstract Entities, Mapped Superclasses, and Non-Entity Classes in an Inheritance Hierarchy
Abstract Entity Class
Mapped Superclass (@MappedSuperclass)
Non-Entity Class
Embedded Non-Entity Class Usage
(@Embeddable and @Embedded)
Polymorphic Relationships
Relationship Mapping
Polymorphic JPQL Queries
Using Native SQL Queries
Composite Primary Keys and Nested Foreign Keys
Using an Embedded Composite Key (@EmbeddedId)
Exposing Composite Key Class Fields Directly on the Entity Class
(@IdClass)
Mapping Relationships That Use Composite Keys
Support for Optimistic Locking (@Version)
Support for Autogenerated Primary Key Values (@GeneratedValue)
Interceptors: Entity Callback Methods
Conclusion

Regards,
Jon
Ko Ko Naing
Ranch Hand

Joined: Jun 08, 2002
Posts: 3178
It seems like your book covers many necessary topics about JPA in a shallow manner. I can see that the topics are to help the readers build a strong foundation in JPA.

By looking at the expanded TOC, I found out that EJB QL topic is not listed, but JPQL. Is "JPQL" in EJB 3.0 a new generation of EJB QL in EJB 2.0? According to the "EJB 3:JPA" book home page, it does cover the new features of EJB QL.

Thanks!
Raghu Kodali
author
Greenhorn

Joined: Oct 05, 2006
Posts: 18
Java Persistence Query Language (JPQL) is an extension to EJB Query Language (EJBQL) which was defined in the earlier versions of the specification.

-raghu
 
jQuery in Action, 2nd edition
 
subject: EJB 3: JPA versus Beginning EJB 3 App Dev