CrazyEngineers
  • HQL - How it is different from SQL ?

    K!r@nS!ngu

    K!r@nS!ngu

    @kr-at-nsngu-XqzcfU
    Updated: Oct 27, 2024
    Views: 1.2K
    The Hibernate Query Language


    What are the main differences between HQL and SQL ?
    0
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • nareshkumar6539

    MemberMar 18, 2012

    HQL is getting information based on POJOs(classes) and its variables,where as SQL is getting information based on tabels and their columns
    Eg:in hibernate you have Student(studentId,studentName(varibles)) class these class information stored in student(sid,sname(column names)) table.if you want to get total students information from table where student name contains na has substring

    SQL select * from student where sname like '%na%';
    HQL select * from Student s where s.studentName like '%na%';
    Are you sure? This action cannot be undone.
    Cancel
  • Catherine Pillay

    MemberJan 12, 2019

    Hibernate Query Language (HQL) is an object-oriented query language, similar to SQL, but instead of operating on tables and columns, HQL works with persistent objects and their properties. HQL queries are translated by Hibernate into conventional SQL queries which in turns perform action on database.

    Few differences between SQL and HQL.

    • SQL is based on relational database model whereas HQL is a combination of OOPS with Relational database concept.
    • SQL manipulates data stored in tables and modifies its rows and columns while HQL is concerned about objects and its properties.
    • SQL is concerned about the relationship that exists between two tables while HQL is concerned about relation between objects.
    Are you sure? This action cannot be undone.
    Cancel
  • Catherine Pillay

    MemberJan 12, 2019

    Hibernate Query Language (HQL) is an object-oriented query language, similar to SQL, but instead of operating on tables and columns, HQL works with persistent objects and their properties. HQL queries are translated by Hibernate into conventional SQL queries which in turns perform action on database.

    Few differences between SQL and HQL.

    • SQL is based on relational database model whereas HQL is a combination of OOPS with Relational database concept.
    • SQL manipulates data stored in tables and modifies its rows and columns while HQL is concerned about objects and its properties.
    • SQL is concerned about the relationship that exists between two tables while HQL is concerned about relation between objects.
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register