1 //hql:hibernate Query Language. 2 //Features:3 //>> 1, similar to SQL, the syntax in SQL is basically straightforward to use. 4 //>> 2,sql queries are columns in tables and tables, and HQL queries are objects and properties in objects. 5 //>> 3,hql Keywords are case-insensitive, and the class name and property name are case-sensitive. 6 //>> 4,select can be omitted. 7
HQL (Hibernate Query Language). The traditional SQL language uses structured query methods, which can do little to the data that exists in the form of objects. To do this, Hibernate provides us with a syntax-like SQL language, which is HQL (Hibernate query language), unlike SQL, HQL is an object-oriented query language that can query data that exists as an object
Lhibernate a total of 5 query methods? OID Data Query method? HQL Data Query method? QBC Data Query method? Local SQL Query method? Ogn Data Query methodOID Data Query methodL Premise: The OID of the object has been acquiredL Query: Based on OID, use the Get/load method to query the corresponding dataL Function: Use OID to get corresponding dataHQL Data Query methodL Premise: The data structure and conditions are known to be queriedL Query: Based on Q
Hibernate provides the following ways to retrieve objects(1) Navigation object Graph retrieval method: Navigating to other objects based on objects that have already been loaded(2) OID retrieval method: Retrieving objects According to the OID of the object(3) HQL retrieval method: Using object-oriented HQL query language(4) QBC retrieval method: Use the QBC (Query by Criteria) API to retrieve the object. Th
HQL refers to hibernate query Language, which is hibernate queries the language, has a set of its own query mechanism, its query statements and SQL is very similar, in use can quickly get started. HQL provides essentially all of SQL's query functionality, but there are a lot of places to be aware of when using HQL queries, and this article collates some of the ba
1. Hadoop Java APIThe main programming language for Hadoop is Java, so the Java API is the most basic external programming interface.2. Hadoop streaming1. OverviewIt is a toolkit designed to facilitate the writing of MapReduce programs for non-Java users.Hadoop streaming is a programming tool provided by Hadoop that al
HQL data query for Hibernate, hibernatehql
1. HQL Introduction
HQL is an Object-Oriented Query Language. Compared with SQL query language, although it is similar in syntax, it parses data tables at runtime, but HQL does not operate on data tables as SQL does, database objects such as columns. The objects operated by
Object Query
Example 1: hql
Code
String hql = "from user ";
List list = session. createquery (hql). List ();
String hql = "from user"; List list = session. createquery (hql). List ();
Because hql statements ar
Hql:hibernate Query Language (Hibernate-specific querying language)HQL is an object-based query language, and its syntax is similar to SQL, but he differs from SQL in that SQL is a table-and field-oriented query, and HQL is an object-and attribute-oriented query.Demand 1. Find out all the items@Test Public voidTestfindallporject () {//Get Hibernate sessionSession session =hibernateutils.getsession (); //Def
1. Querying all fields of the entire mapping object
The direct from query is a mapping object, that is: querying the entire Mapping object all fields
String hql = "from Users";
Query query = session.createquery (HQL);
list
2. Querying a single field
Query single field
String hql = "SELECT name from Users";
Hive optimization tips-How to Write HQL
I. Hive join Optimization1. try to place the small table on the left of join. The hive-0.12.0 we use here is automatically converted. This means that the small table is automatically loaded into the memory and the map side join is executed (with good performance ), this is done by the hive parameter. auto. convert. join = true and hive. smalltable. filesize = 25000000L) parameter control (25 MB by default). If t
This note continues to use the Dept Department table, EMP staff table, one-to-many pair of bidirectional mappings.1 Conditional query1.1 Query Employee Form EMP Age eage less than 30, monthly esal greater than 20000 employee name EnameSql:select ename from EMP where eageHql:select ename from Emp where eage1.2 Settings and aliases for question marksQuestion mark (? ) is set using the. Setparameter (position, property value) The position of the question mark in the SQL statement is starting at 1 a
The previous article discussed the connection query in the HQL query, its query syntax in the function and SQL connection query is the same, the inner join query obtains the Cartesian product between the relations, the outer join query is to obtain a relational table and with another relational table of the collection part, the specific use method see the previous article, Finally, the method of the external named query is discussed. This article will
DirectoryWrite in frontDocumentation and series articlesSeveral ways to queryHQL QueryAn exampleSummarizeWrite in frontThe previous article introduced the basic configuration of NHibernate in the project, including the setting of the database connection string, the configuration of the mapping file, and the place to be aware, this article describes the NHibernate query method.Documentation and series articles[Nhibernate] Architecture[NHibernate] Isessionfactory Configuration[NHibernate] Persiste
Last time we learned to use the criteria for the relevant operations, but because the criteria is not hibernate the official recommendation of the query, we do not use much. Now let's take a look at the official hql and learn about its strength.Say is HQL, namely Hibernate query statement, and SQL what is the difference? The difference of a letter, haha.Of course not, the difference between
HIBERNATE-HQL QueryHQL is the acronym for Hibernate Query Language, an object-oriented query language and the most common query language in hibernate.(i) Basic grammar of HQL
Select "Property name" from "Object"where "condition"Group BY "attribute name" having "grouping condition"Order By "Property name" Desc/asc
The previous section describes the most basic entity classes. This section describes the HQL statement constructor, including query and update.
Advantages: It is faster to construct HQL statements in an object-oriented manner and does not require manual HQL concatenation.
Disadvantages: Encapsulation may reduce performance and only supports common and simple
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.