Preface

There are multiple databases available to store our valuable data. When we go for relational data structures, we can perform any operation on the data using queries on the interface provided by the database vendor or using a third party tool. The syntax for all databases is almost similar, but some databases follow their own syntax and semantics of writing a query. Nowadays, real-world applications require a quick development cycle, database-independent query execution, and a generic code that can be supported by multiple databases. It's a very hard and time-consuming task for a software developer to fulfill this set of requirements.

Hibernate is an ORM (Object Relational Mapping) tool that helps us by making our development process faster and making the software development independent of the database; so, we can easily change a database vendor without worrying about the changes required in code. Therefore, whether you are developing a standalone Java application or a server-side Java Enterprise application, you could use hibernate to make your code database-independent.

Java Hibernate Cookbook will help you to learn hibernate from the basics to an advanced level. In this book, we will try to create simple and short recipes to understand hibernate step by step.

What this book covers

Chapter 1, Setting Up Hibernate, provides the basics of hibernate and the persistent class. Next, you will learn to obtain the required libraries, XML and annotation-based configuration, and the mapping required for hibernate.

Chapter 2, Understanding the Fundamentals, takes you through the basic objects required to start working with hibernate, such as SessionFactory, Session, Criteria, Projection, and so on.

Chapter 3, Basic Annotations, covers the very basic annotations that are useful and necessary while writing with hibernate, such as declaring table (@Table), declaring column (@Column), declaring primary key (@Id), and so on.

Chapter 4, Working with Collections, explains how collections work with hibernate and how to persist Java collections such as List, Map, Set, and so on using hibernate.

Chapter 5, Working With Associations, helps you to understand relationships and associations such as one-to-one, one-to-many (many-to-one), and many-to-many. In this chapter, you will discover the simplest way to implement a relationship using hibernate.

Chapter 6, Querying, applies the basics of hibernate to query a database. This chapter helps you to understand the fundamentals of hibernate such as alias, subquery, NamedQuery, formula, and HQL.

Chapter 7, Advanced Concepts, helps you to learn the advanced concepts in hibernate such as caching, inheritance strategy, versioning, and maintaining the history of the objects.

Chapter 8, Integration with Other Frameworks, explains integration with other MVC frameworks such as Struts and Spring. It shows how to achieve a persistent life cycle in the frameworks.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.231.194