10. Criteria object introduction in Hibernate:

Author: Zen and the Art of Computer Programming

1 Introduction

  Hibernate is one of the most popular ORM frameworks in the Java world. It is positioned at the mapping layer between the framework and the database, which provides a flexible way to map the object-relational model to various database tables, and provides an object-oriented query language (HQL) to query data. Hibernate provides a transparent processing mechanism for SQL, enabling developers to complete data access, update and other operations without directly writing SQL statements, which greatly improves development efficiency and system performance. In Hibernate, Criteria is a high-level interface to a database for retrieving data. Criteria can be very convenient for conditional query, sorting, paging and other operations. Hibernate introduced the Criteria object after version 4 to replace the HQL query, which can be more intuitive and easy to understand. This article will introduce the Criteria object in Hibernate in detail from the following aspects: * Characteristics of Criteria in Hibernate; * Usage of Criteria in Hibernate; * Principle of Criteria in Hibernate and how to use native API; * Comparison between Criteria and other components in Hibernate ; * Precautions and tips. After reading this article, you also need to master the skills and precautions of Criteria object application in Hibernate. The following article will introduce in detail the Criteria object application skills and precautions in Hibernate. Welcome to continue to pay attention to our original technology blog. # 2. Criteria object concept in Hibernate ## 2.1 Criteria features in Hibernate The Criteria object in Hibernate has the following characteristics: 1. The Criteria object is similar to the PreparedStatement object in JDBC, and parameters can be set; 2. The Criteria object can execute Various types of queries, including conditional queries

Guess you like

Origin blog.csdn.net/universsky2015/article/details/132002435