Author image

Hibernate Object Relational Mapping (ORM) Tutorial

Hibernate is a Java open source, lightweight & performant ORM framework that simplifies the development of Java server applications when interacting with a database. ORM stands object relational mapping. It maps between an Object oriented language (Java here) and a Relational language (SQL), to execute database queries in an OOP way rather than using SQL.

This demo provides all you need to get setup in Java with your database queries. The main pieces of code are 4 .java files in src\main\java\ directory. The queries are database independent though and they can work no matter the database backend. I've tested this to be true on MySQL and SQLAlchemy. This is accomplished by HQL (Hibernate Query Language) the object-oriented version of SQL which Hibernate converts to SQL under the hood.