This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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
Ko Ko Naing
Joined: Jun 08, 2002
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.