Posts Tagged ‘jpa’

Unit testing JPA 2

October 7th, 2010 1 comment

When you want to test JPA 2 (JPQL & Criteria), it can get pretty challenging. Here is nice post on testing JPA 2

Unit testing JPA 2

Primary Key Generation Strategies in Hibernate

October 10th, 2009 No comments

In this post we will explore useful Key Generation Strategies in Hibernate for MYSQL DB.

Each database table row usually will be identified by a unique column value. Using this value one can fetch data and identify the data. This key plays important role in managing the relational data.  This unique identity can be called key or id.   

Read more…

Working with Hibernate and JPA

October 10th, 2009 No comments

Recently I was experimenting with possible combination of Hibernate and JPA. As a developer, one can have options of using hibernate mapping files or annotations (both jpa and hibernate) or JPA mapping files with JPA style Entity managers.  Following are the possible combination which I found useful:

Read more…

New JPA features overview

October 8th, 2009 No comments

Sun would be releasing its new Java Persistence API (JPA) 2.x as part of its new Java EE 6 Platform release in Summer of 2009.  Java Persistence API (JPA) 2.0, introduced with Java EE 6, adds in and specifies fully many things which were missing in JPA 1.0.

Below is the presentation by Mike Keith on Infoq on new featires of JPA2.0

New features of JPA 2.0

Spring JPA Tutorial – Get Hands on Experience

October 4th, 2009 14 comments

Following we demonstrate you how a simple user contact information is saved using Spring and JPA. We use Hibernate as JPA provider.

Spring is a container which supports multiple frameworks and multiple services. Spring wraps the services and the frameworks together.

Spring’s Basic concept: Inversion of Control

The basic concept of spring is the Inversion of Control pattern (dependency injection). In Spring, programmers don’t need to create user objects but they need to describe how they should be created (in applicationContext.xml or using annotations). Programmers need not directly connect components and services together in code but describe which services are needed by which components in a configuration file or using annotations. The spring container is responsible for all this. Spring creates all the objects, connects them together by setting the necessary properties, and determines when methods will be invoked.

Read more…