Book description
Hibernate continues to be the most popular out-of-the-box framework solution for Java Persistence and data/database accessibility techniques and patterns. It is used for e-commerce–based web applications as well as heavy-duty transactional systems for the enterprise.
Gary Mak, the author of the best-selling Spring Recipes, now brings you Hibernate Recipes. This book contains a collection of code recipes and templates for learning and building Hibernate solutions for you and your clients.
This book is your pragmatic day-to-day reference and guide for doing all things involving Hibernate. There are many books focused on learning Hibernate, but this book takes you further and shows how you can apply it practically in your daily work.
Table of contents
- Copyright
- About the Authors
- About the Technical Reviewer
- Acknowledgments
-
1. Starting with Hibernate
- 1.1. Setting Up Hibernate
- 1.2. Programming with Basic JDBC
- 1.3. Configuring Hibernate
- 1.4. Configuring a JPA Project
- 1.5. Using Entity Manager
- 1.6. Enabling Logging in Hibernate
- 1.7. Generating a Database Schema Using Hibernate
- 1.8. Summary
- 2. Basic Mapping and Object Identity
- 3. Component Mapping
- 4. Inheritance and Custom Mapping
-
5. Many-to-One and One-to-One Mapping
- 5.1. Using Many-To-One Associations
- 5.2. Using a Many-to-One Association with a Join Table
- 5.3. Using Lazy Initialization on Many-to-One Associations
- 5.4. Sharing Primary Key Associations
- 5.5. Creating a One-to-One Association Using a Foreign Key
- 5.6. Creating a One-to-One Association Using a Join Table
- 5.7. Summary
- 6. Collection Mapping
-
7. Many-Valued Associations
- 7.1. Mapping a One-to-Many Association with a Foreign Key
- 7.2. Mapping a One-to-Many Bidirectional Association Using a Foreign Key
- 7.3. Mapping a One-to-Many Bidirectional Association Using a Join Table
- 7.4. Mapping a Many-to-Many Unidirectional Association with a Join Table
- 7.5. Creating a Many-to-Many Bidirectional Association with a Join Table
- 7.6. Summary
- 8. HQL and JPA Query Language
- 9. Querying with Criteria and Example
- 10. Working with Objects
- 11. Batch Processing and Native SQL
-
12. Cashing in Hibernate
- 12.1. Using the Second-Level Cache in Hibernate
- 12.2. Concurrency Strategies
- 12.3. Cache Providers
- 12.4. What Are Cache Regions?
- 12.5. Caching Query Results
- 12.6. Using the First-Level Cache
- 12.7. Configuring the Second-Level Cache
- 12.8. Caching Associations
- 12.9. Caching Collections
- 12.10. Caching Queries
- 12.11. Summary
- 13. Transactions and Concurrency
-
14. Web Applications
-
14.1. Creating a Controller for the Bookshop Web Application
- 14.1.1. Problem
- 14.1.2. Solution
-
14.1.3. How It Works
- 14.1.3.1. Creating a Dynamic Web Project
- 14.1.3.2. Configuring the Connection Pool
- 14.1.3.3. Developing an Online Bookshop
- 14.1.3.4. Creating a Global Session Factory
- 14.1.3.5. Listing Persistent Objects
- 14.1.3.6. Updating Persistent Objects
- 14.1.3.7. Creating Persistent Objects
- 14.1.3.8. Deleting Persistent Objects
- 14.2. Creating a Data-Access Layer
- 14.3. Summary
-
14.1. Creating a Controller for the Bookshop Web Application
Product information
- Title: Hibernate Recipes: A Problem-Solution Approach
- Author(s):
- Release date: July 2010
- Publisher(s): Apress
- ISBN: 9781430227960
You might also like
book
Hibernate Recipes: A Problem-Solution Approach, Second Edition
Hibernate Recipes, Second Edition contains a collection of code recipes and templates for learning and building …
book
Java Hibernate Cookbook
Over 50 recipes to help you build dynamic and powerful real-time Java Hibernate applications About This …
book
Harnessing Hibernate
Harnessing Hibernate is an ideal introduction to the popular framework that lets Java developers work with …
book
Just Hibernate
If you’re looking for a short, sweet, and simple introduction (or reintroduction) to Hibernate, this is …