Getting Started With Hibernate
| |

Getting Started With Hibernate

Hibernate is a very popular implementation of the Java Persistence API (JPA) standard. It acts as an additional layer on top of JDBC and enables you to implement a database-independent persistence layer. Hibernate provides an object-relational mapping implementation that maps your database records to Java objects and generates the required SQL statements to replicate all operations to the database. Let’s…

What’s the difference between persist, save, merge and update? Which one should you use?
|

What’s the difference between persist, save, merge and update? Which one should you use?

JPA and Hibernate provide different methods to persist new and to update existing entities. You can choose between JPA’s persist and merge and Hibernate’s save and update methods. It seems like there are 2 pairs of 2 methods that do the same.  You can use the methods persist and save to store a new entity…