JPA 2.0 New Features

java-ee-thumbnail

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

hibernate-thumbnail

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

hibernate-thumbnail

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

hibernate-thumbnail

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

hibernate-thumbnail

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

hibernate-thumbnail

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 […]

Hibernate Exception – org/dom4j/DocumentException

hibernate-thumbnail

If you are setting up the first hibernate application, there is chance that you would get the following exception if the required dependency is missed. The reason is you have not included the dom4j-1.6.1.jar file which is used internally by the hibernate core for parsing the XML documents. The result will be the following exception. Either you […]

openSession and getCurrentSession Difference in Hibernate

hibernate-thumbnail

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 […]

Hibernate Dependency Library Exception (JTA) : javax/transaction/SystemException

hibernate-thumbnail

If you are developing hibernate application, you would encounter the following exception if you have not added the jta-1.1.jar in your libraries. This JAR file is used in the hibernate transaction development. However, when you run the configuration itself will throw the exception if the JAR file is not found. Lets see how you can get […]

Hibernate Dependency Library Exception (JPA) : javax/persistence/SharedCacheMode

hibernate-thumbnail

If you are developing hibernate application, you would encounter the following exception if you have not added the hibernate-jpa-2.1-api-1.0.0.Final.jar in your libraries. Lets see how you can get this JAR file. Exception Trace