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 …
JPA 2.0 New Features
Java Persistance API (JPA) is the object relational mapping (ORM) specification for Java EE applications. It is only the specification, every framework owners can implement their own persistence layer following the JPA specification. Standardizing three major competing vendors of ORM technologies, Hibernate, JDO and Toplink, into one standard is the JPA 1.0 specification. JPA 1.0 …
Hibernate 4 Basic Configuration + Setup Example
This tutorial explains the very basic configuration and installation of hibernate configuration for your project. It is a standalone program, but the same configuration would applicable for the web applications. Here I am using the XML configuration approach, I will write another tutorial for using the annotations. Here I assume that you have installed the …
How To Create Session Factory in Hibernate 4
There are many APIs deprecated in the hibernate core framework. One of the frustrating point at this time is, hibernate official documentation is not providing the clear instructions on how to use the new API and it stats that the documentation is in complete. Also each incremental version gets changes on some of the important …
Deprecated @Entity Annotation in Hibernate 4
In the earlier versions of Hibernate, we use @Entity for marking a class as persistence entity in the database. It has list of attributes to be used as the parameters. @Entity has been deprecated from the hibernate 4 and will be removed from the hibernate 5.0 release. There is a confusion in the consistency of …
Hibernate Exception – javassist.util.proxy.MethodFilter
If you are using Hibernate 4, you would hit this exception while setting up the first hibernate application. The missing library is javassist. To resolve this problem, either manually download the JAR file or add the below maven try to your project’s POM.xml. Once you added these library, the error will be fixed. This library …
Hibernate Exception – Unable to load class com.mysql.jdbc.Driver
If you are using MySQL database for your hibernate application, then you have to add the MYSQL driver library in your classpath for accessing the database. If you fail to do that, you will end up in the following exception. You can manually download that jar file or add the maven entry as below. Exception …
openSession and getCurrentSession Difference in Hibernate
When you get a session from the session factory object in hibernate, either you can use openSession or getCurrentSession. If you are using the openSession method, it opens a new session freshly. If you use getCurrentSession, it gets the current session from the existing thread context instead of opening a new session. You should have …