If you are working on hibernate, getting QuerySyntaxException is very common if there is any issue with the query which you are trying to execute in your code. This QuerySyntaxException is more generic and it would throw different types of error messages based on the issue with the query. In this post I would update my experience …
Hibernate
Hibernate / JPA – Detached entity passed to persist exception
You are here because you have just thrown out by your application with this annoying exception : javax.persistence.PersistenceException: org.hibernate.PersistentObjectException: detached entity passed to persist. There are multiple reasons that could cause this exception. But, basic idea behind this exception is that the object which you are trying to persist is not in the persistant state. …
Introduction to Hibernate Envers
Hibernate Envers is a library that helps us to easily achieve audit functionality. It aims to enable easy auditing/versioning of persistent classes/entities. It provides a built in mechanism to maintain history of tables in Hibernate. Hibernate Envers has been created by Adam Warski. From Hibernate 3.5, Envers is part of core module. Envers works in a similar fashion to Version …
JPA Vs Hibernate
I have come across this question from many of our readers and who ever working on the hibernate framework : What is the difference between Java Persistence API (JPA) and Hibernate ORM Framework. This post simply answer to those who are confusing with JPA and Hibernate difference. JPA and Hibernate Difference JPA is a specification for …
How To Create EntityManagerFactory in JPA
This tutorial explains how to create EntityManagerFactory in your JPA application when you are writing your first JPA programming. It is the standard way of creating the factory if you use the JPA specification. Normally there are two ways to create the factory, one is through the configuration file persistence.xml and another one is through the …
JPA EntityManagerFactory Vs Hibernate’s SessionFactory
If you are using the JPA’s standard specification implementation (Read : Introduction to JPA), then you would use EntityManagerFactory for opening the session. But, if you are using the hibernate implementation, you have hibernate specific SessionFactory for managing the sessions. Here there is lot of confusion between developers like which one is the best approach. …
JPA 2 MetaModel Generator using Ant
In my previous article I have explained how to generate metamodel using your Eclipse IDE. However, in most scenarios you will have to create from your build scripts. This tutorial explains how to add this option in your ant script. For the detailed explanation on project example code, please refer the previous post. Here I …
JPA 2 MetaModel Generation using Eclipse
JPA 2.0 introduces the strongly typed Criteria API for going away with the Java Persistence Query (JQL) language. It comes with the metamodel for helping the typed objects. Every entity must have a meta model generated with underscore(_) added to its name. These objects will be referred in the Criteria API instead of using the …