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).

I have developed this demo on my Windows 8.1 x86_64 computer, using IDEA 2018.1 and for the SQL database side I've used XAMPP v3.2.2 and MySQL on port 6180.

This demo provides all you need to get setup in Java with your database queries started. 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 translates to behind the scenes.

orm hibernate demo

I was impressed with this framework. It is now my go-to choice of server - database applications in Java.


Github repository link.