I\'m using EclipseLink in my J2SE project. I\'m using mysql and JPA. I have a simple entity with primary key and String field. I can read from database using EntityManager#createQuery but when I try t
public enum ReportStatus { SUCCCEED, FAILED; } public class Work { @ElementCollection @Enumerated(EnumType.STRING)
Let\'s say we have an entity object. Is there a way to extract a primary key from it? I want to do something like this:
I am a newbie with Maven2 and I write a pom.xml. Now I want to get Hibernate and javax.persistence to resolve this:
i\'m struggling to create a jpa query that makes use of several tables. i cannot seem to understand how to join the tables together. this is the query i am trying to create:
Is there a possiblity in JPA 2.0 to set a collection for in-clause in jpql-query? (I\'m using EclipseLink)
This question already has answers here: JPA: How do I specify the table name corresponding to a class at runti开发者_C百科me?
In Sun Online resources, they provide开发者_JAVA技巧 son example about the usage of the Criteria/Metamodel API, but as far as I understand Java, it seems to be impossible to work:
I would like to use JPA2 Criteria API with metamodel objects, which seems to be pretty easy: ... Root<JPAAlbum> albm = cq.from(JPAAlbum.class);
How would you go about unit testing an EJB that uses JPA? For example, if I have an Order entity an开发者_如何学编程d and OrderEJB that is supposed to calculate the total of an order (as defined below