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 …
Difference Between Class.forName() and ClassLoader.loadClass()
Class.forName() and ClassLoader.loadClass(), both the classes dynamically loading the classes to the classpath. However, there are subtle difference on initializing the classes at the time of loading and from where it is loaded. This tutorials compares both the form of class loading with simple examples. Class.forName() By default the classes are initialized at the time …
JPA 2 Tutorials
Java Persistance API (JPA) is the object relational mapping (ORM) specification for Java EE applications. JPA 2 is the second major release for the JPA framework with lot of interesting features. Many of the features introduced with this release are already supported by the many of the framework vendors like Hibernate, EclipseLink, etc. This JPA 2 …
TypedQuery in JPA 2
One of the new feature introduced in JPA 2.0 is using the TypedQuery interface for building the query. This can be used with the CriteriaBuilder in JPA 2. As the name itself specifies, the main purpose of using the TypedQuery would be to narrow the result type and eliminate the need for type casting after …
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. …
How To Generate Javadoc With Ant
This tutorial explains how to create Java documentation using the ant script. Every project has Java doc for the documentation purpose. If you have huge application, there should be a clear Java doc for the developers to aware of all the classes and its purposes. If the developers add good comments on their code, Java …
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 …