Comparison of SQL HQL JPQL CQL

Source: Internet
Author: User

SQL ( Structured Query Language ) is the relational database query language. the from is followed by the "table name", where the condition is followed by "field in table"
HQL ( Hibernate Query Language ) is an object-oriented query , The from is followed by the table name, where the condition is followed by the field in the table.    When you use queries in Hibernate,
Generally use HQL query statements. Because HQL is object-oriented, and the names and properties of object classes are case-sensitive, they are case-sensitive.
 JPQL (Java presistence Query Language) is the object query language created by JPA in EJB3.0. JPQL are fully object-oriented, with inheritance, polymorphism, and correlation features,
very similar to hibernate hql. Based on the firstEJB Query Language (EJB QL) introduced in the EJB2.0,Java Persistent Query Language (JPQL) is a portable query language,designed for object-oriented expression language
The expression,binds SQL syntax to simple query semantics. Queries written in this language are portable and can be compiled into SQL on all major database servers.
The JPQL statement supports two ways of defining a parameter: named parameter and positional parameter. Only one parameter definition mode is allowed in the same query statement.

CQL(Cloud query Language) is a subset and variant of the SQL query syntax that Leancloud has customized for the query API to enable developers to use traditional SQL syntax to query
leancloud Cloud data,This reduces the cost of Learning Leancloud query APIs. major differences with SQL:adding aliases to columns with the AS keyword in select is not supported. Update and delete
Bulk updates and deletions are not available, and a document can only be updated or deleted based on objectId ( where objectId=xxx ) and other criteria. not supported join , correlated queries provided include , relatedTo etc.
syntax to replace (relational query). only partial SQL functions (built-in functions) are supported. does not support,,,, group by having , and max min sum distinct so on group aggregation query syntax. transactions are not supported.
locks are not supported.

Comparison of SQL HQL JPQL CQL

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.