Book description
Pro JPA 2 introduces, explains, and demonstrates how to use the new Java Persistence API (JPA). JPA provides Java developers with both the knowledge and insight needed to write Java applications that access relational databases through JPA. Authors Mike Keith and Merrick Schincariol take a hands-on approach to teaching by giving examples to illustrate each new concept of the API and showing how it is used in practice.
Table of contents
- Copyright
- Foreword
- About the Author
- About the Technical Reviewer
- Acknowledgments
- Preface
- 1. Introduction
- 2. Getting Started
-
3. Enterprise Applications
- 3.1. Application Component Models
- 3.2. Session Beans
- 3.3. Message-Driven Beans
- 3.4. Servlets
- 3.5. Dependency Management
- 3.6. Transaction Management
- 3.7. Using Java EE Components
- 3.8. Putting It All Together
- 3.9. Summary
-
4. Object-Relational Mapping
- 4.1. Persistence Annotations
- 4.2. Accessing Entity State
- 4.3. Mapping to a Table
- 4.4. Mapping Simple Types
- 4.5. Mapping the Primary Key
- 4.6. Relationships
- 4.7. Embedded Objects
- 4.8. Summary
- 5. Collection Mapping
-
6. Entity Manager
- 6.1. Persistence Contexts
- 6.2. Entity Managers
- 6.3. Transaction Management
- 6.4. Choosing an Entity Manager
- 6.5. Entity Manager Operations
- 6.6. Synchronization with the Database
- 6.7. Detachment and Merging
- 6.8. Summary
- 7. Using Queries
- 8. Query Language
-
9. Criteria API
- 9.1. Overview
-
9.2. Building Criteria API Queries
- 9.2.1. Creating a Query Definition
- 9.2.2. Basic Structure
- 9.2.3. Criteria Objects and Mutability
- 9.2.4. Query Roots and Path Expressions
- 9.2.5. The SELECT Clause
- 9.2.6. The FROM Clause
- 9.2.7. The WHERE Clause
- 9.2.8. Building Expressions
- 9.2.9. The ORDER BY Clause
- 9.2.10. The GROUP BY and HAVING Clauses
- 9.3. Strongly Typed Query Definitions
- 9.4. Summary
-
10. Advanced Object-Relational Mapping
- 10.1. Table and Column Names
- 10.2. Complex Embedded Objects
- 10.3. Compound Primary Keys
- 10.4. Derived Identifiers
- 10.5. Advanced Mapping Elements
- 10.6. Advanced Relationships
- 10.7. Multiple Tables
- 10.8. Inheritance
- 10.9. Summary
-
11. Advanced Topics
- 11.1. SQL Queries
- 11.2. Lifecycle Callbacks
- 11.3. Validation
- 11.4. Concurrency
- 11.5. Refreshing Entity State
- 11.6. Locking
- 11.7. Caching
- 11.8. Utility Classes
- 11.9. Summary
-
12. XML Mapping Files
- 12.1. The Metadata Puzzle
-
12.2. The Mapping File
- 12.2.1. Disabling Annotations
- 12.2.2. Persistence Unit Defaults
- 12.2.3. Mapping File Defaults
- 12.2.4. Queries and Generators
- 12.2.5. Managed Classes and Mappings
- 12.3. Summary
-
13. Packaging and Deployment
- 13.1. Configuring Persistence Units
- 13.2. Building and Deploying
- 13.3. Outside the Server
- 13.4. Schema Generation
- 13.5. Summary
- 14. Testing
- 15. Migration
Product information
- Title: Pro JPA 2: Mastering the Java™ Persistence API
- Author(s):
- Release date: December 2009
- Publisher(s): Apress
- ISBN: 9781430219569
You might also like
book
Rapid Java Persistence and Microservices: Persistence Made Easy Using Java EE8, JPA and Spring
Gain all the essentials you need to create scalable microservices, which will help you solve real …
book
Pro Jakarta Persistence in Jakarta EE 10: An In-Depth Guide to Persistence in Enterprise Java Development
Learn to use the Jakarta Persistence API and other related APIs as found in the Jakarta …
book
Java Persistence with Hibernate
Java Persistence with Hibernate explores Hibernate by developing an application that ties together hundreds of individual …
book
Spring Data
You can choose several data access frameworks when building Java enterprise applications that work with relational …