JPA vs Hibernate - An In-depth comparison
Often, we come across the terms JPA and Hibernate. Quite often, they are used interchangeably as well. Also, if you try to read up some tutorial to JPA, there will be a reference to Hibernate in it. So also, when you are studying Hibernate, you will come across references to JPA too. So it is often confusing for developers. In this post, I will attempt to clear this confusion. What is Hibernate? Hibernate is an ORM tool. ORM is nothing but a programming technique that allows you to map Java objects to database tables and vice versa. In addition to Hibernate, there are several other ORM tools. Before Hibernate came into existence, JDBC was widely used to access a relational database from Java code. The downside of JDBC is that it is not very object oriented. It is very hard to map database tables to the code. Hibernate allows you to directly map your database tables to Java classes. So compared to JDBC, Hibernate provides a much cleaner approach. However, there is a disadvantage to usi