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 : What happens when you do this with JPA 1.0 ? The ArrayList implements Serializable so the entire list gets serialized into a blob column. What are the other choices ? Well, … 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