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 entity has a list of tags and tags are just strings. So you want to do the following : [sourcecode language=”java”] @Entity public class Book { @Id @GeneratedValue private Long id; private String title; private Float price; private String description; private String isbn; private Integer nbOfPage; private List<String> tags = … Continue reading Mapping and querying a list of primitive types with JPA 2.0

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, so for each persistence provider you would have to use … Continue reading JPA 2.0 : standard properties in persistence.xml