Chapter 6. Querying

In this chapter, we will cover the following recipes:

  • Working with an alias
  • Performing aggregate operations
  • Executing a subquery using a criteria
  • Executing a native SQL query
  • Executing a query using HQL
  • Using a formula in hibernate
  • Working with NamedQuery

Introduction

This chapter shows a different functionality and an API used to query with hibernate. In this chapter, you will also learn how hibernate provides a facility to perform complex queries in an object-oriented manner.

We will discuss a number of functionalities useful while querying, such as an alias, aggregate functions, and subquery. Sometimes, we need to use a native SQL in hibernate, and you will also learn about executing it. Apart from this, you will learn HQL (Hibernate Query Language), which provides a purely object-oriented way to execute the query, NamedQuery, and formulas.

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

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