When you want to test JPA 2 (JPQL & Criteria), it can get pretty challenging. Here is nice post on testing JPA 2
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.
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:
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
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.