Book description
Over 50 recipes to help you build dynamic and powerful real-time Java Hibernate applications
About This Book
- Learn to associate JDBC and Hibernate with object persistence
- Manage association mappings, implement basic annotations and learn caching
- Get to grips with Hibernate fundamentals from installation to developing a business application with this step-by-step guide
Who This Book Is For
This is book for Java developers who now want to learn Hibernate. Good knowledge and understanding of Java is preferred to allow efficient programming of the core elements and applications; it would be helpful if readers are familiar with the basics of SQL.
What You Will Learn
- Set up and install Hibernate on your system and explore different ways in which Hibernate can be configured
- Learn the basic concepts and fundamentals of Java Hibernate
- Define mappings without a use of XML file using Annotations
- Persist collection elements such as list, map, set and array
- Explore the various mapping options and learn to work with Hibernate associations
- Understand advanced Hibernate concepts such as caching and inheritance
- Develop an engaging and robust real-world hibernate application based on a common business scenario
- Integrate Hibernate with other frameworks to develop robust enterprise applications
In Detail
Hibernate is a database independent technology, so the same code will work for all databases. It helps a Java developer write a query by mapping Java bean to database tables and help create tuned queries that boost performance. Even with limited SQL knowledge one can easily perform database operations. This makes the development faster and more accurate than JDBC. Hibernate supports useful features like connection pooling, caching, and inheritance etc.
This book will provide a useful hands-on guide to Hibernate to accomplish the development of a real-time Hibernate application.
We will start with the basics of Hibernate, which include setting up Hibernate ? the pre-requisites and multiple ways of configuring Hibernate using Java. We will then dive deep into the fundamentals of Hibernate such as SessionFactory, session, criteria, working with objects and criteria. This will help a developer have a better understanding of how Hibernate works and what needs to be done to run a Hibernate application. Moving on, we will learn how to work with annotations, associations and collections. In the final chapters, we will see explore querying, advanced Hibernate concepts and integration with other frameworks.
Style and approach
This book is a practical guide filled with carefully organized step-by-step instructions. All recipes are arranged in an easy-to understand and clear manner allowing you to apply the solutions to other situations.
Table of contents
-
Java Hibernate Cookbook
- Table of Contents
- Java Hibernate Cookbook
- Credits
- About the Authors
- About the Reviewers
- www.PacktPub.com
- Preface
-
1. Setting Up Hibernate
- Introduction
- Getting the required libraries for hibernate
- Creating a hibernate persistent class
- Providing an XML-based hibernate mapping
- Providing an annotation-based hibernate mapping
- Providing a hibernate configuration using an XML file
- Providing a hibernate configuration using the properties file
- Configuring hibernate programmatically
-
2. Understanding the Fundamentals
- Introduction
- Building a SessionFactory
- Creating a generic SessionFactory provider class
- Opening a new session
- Opening a stateless session
- Saving an object to the database
- Fetching an object from the database
- Removing an object from the database
- Updating an object
- Creating a criteria
- Restricting the results using a criteria
- Pagination using a criteria
- Sorting the results
- Transforming a result
- Using basic projection
- 3. Basic Annotations
- 4. Working with Collections
- 5. Working with Associations
- 6. Querying
-
7. Advanced Concepts
- Introduction
- Working with a first-level cache
- Working with a second-level cache
- Working with a query cache
- Working with the table per class hierarchy strategy of inheritance
- Working with the table per subclass strategy of inheritance
- Working with the table per concrete class strategy of inheritance
- Working with the versioning of objects
- Maintaining the history of an object
- Working with an interceptor
- Working with batch processing
- 8. Integration with Other Frameworks
- Index
Product information
- Title: Java Hibernate Cookbook
- Author(s):
- Release date: September 2015
- Publisher(s): Packt Publishing
- ISBN: 9781784391904
You might also like
book
Hibernate Recipes: A Problem-Solution Approach
Hibernate continues to be the most popular out-of-the-box framework solution for Java Persistence and data/database accessibility …
book
Harnessing Hibernate
Harnessing Hibernate is an ideal introduction to the popular framework that lets Java developers work with …
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
Beginning Hibernate: For Hibernate 5
Get started with the Hibernate 5 persistence layer and gain a clear introduction to the current …