The Artima Developer Community
Sponsored Link

Java Buzz Forum
Hibernate Query Langugae (HQL)

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
instanceof java

Posts: 576
Nickname: instanceof
Registered: Jan, 2015

instanceof java is a java related one.
Hibernate Query Langugae (HQL) Posted: Oct 22, 2016 12:34 PM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by instanceof java.
Original Post: Hibernate Query Langugae (HQL)
Feed Title: Instance Of Java
Feed URL: http://feeds.feedburner.com/blogspot/TXghwE
Feed Description: Instance of Java. A place where you can learn java in simple way each and every topic covered with many points and sample programs.
Latest Java Buzz Posts
Latest Java Buzz Posts by instanceof java
Latest Posts From Instance Of Java

Advertisement
Hibernate Query Language:

  • HQL is one of the feature of Hibernate.
  • HQL is same like SQL but here it uses class name as table name and variables as columns.
  • HQL is Database independent query language.
  • An object oriented form of SQL is called HQL
  • HQL syntax is very much similar to SQL syntax.  Hibernate Query Language queries are formed by using Entities and their properties, where as SQL quires are formed by using Tables and their columns.
  • HQL Queries are fully object oriented..
  • HQL Queries are case sensitive.


Advantages of HQL:

  • Database Independent
  • HQL Queries supports inheritance and polymorphism
  • Easy to learn. 

Query Interface:

  • Query interface used to Represent HQL query in the form of query object.
  • The object of  query will be created by calling createQuery(hql query) method of session.

    1.  Session hsession = sf.openSession();
    2. Query query = hsession.createQuery(hql query);

    • Send the query object to hibernate software by calling the list method.
    • Hibernate returns an ArrayList object render the ArrayList object and display the output to client.

    1. List l = query.list();
    2. ArrayList emplist = (ArrayList)l;

    • Query is an interface which is available as port of org.hibernate package. We can not create the object to query interface. We can create a reference variable and it holds implementation class object.

     Methods of Query Interface:

    HQL hibernate query language

    Read: Hibernate Query Langugae (HQL)

    Topic: JavaFX 2D Shape Example Previous Topic   Next Topic Topic: Apache Tomcat Http Connector Example

    Sponsored Links



    Google
      Web Artima.com   

    Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use