JPA 2.0 Criteria API with Maven and EclipseLink

For those of you who have followed the JPA 2.0 specification, you might have come across the new Criteria API. The main idea of this new API is to be able to write a JPQL query using an object-oriented way (through a rich API) instead of a String. For example, if you want to return … Continue reading

Mapping and querying a list of primitive types with JPA 2.0

Sometimes you just want to map a list of primitive types. For example, a Book has a list of tags and tags are just strings. So you want to do the following : @Entity public class Book { @Id @GeneratedValue private Long id; private String title; private Float price; private String description; private String isbn; … Continue reading

JPA 2.0 : standard properties in persistence.xml

As you might know with JPA, the META-INF/persistence.xml file defines a persistence unit with some provider’s properties. For example, if you are using JPA in a Java SE environment, you will have to define the JDBC driver, database connexion (user and password), database URL and so forth. In JPA 1.0 these properties were not standard, … Continue reading


Get every new post delivered to your Inbox.

Join 7,479 other followers