Showing posts with label JPA. Show all posts
Showing posts with label JPA. Show all posts

Tuesday, May 17, 2011

Published 5/17/2011 by with 0 comment

No Persistence provider for EntityManager named

Are you using JPA and getting the error "Exception in thread "main" javax.persistence.PersistenceException: No Persistence provider for EntityManager named ..." You might have used an entity manager as the following code: public void persist(Object object) {         EntityManagerFactory emf = Persistence.createEntityManagerFactory("TestPU");         EntityManager...
Read More

    email this       edit
Published 5/17/2011 by with 1 comment

is not a known entity type

To understand the error, let us assume that we have the following classes: 1) An entity class package person.entity; import java.io.Serializable; import java.util.Date; import javax.persistence.Basic; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.NamedQueries; import...
Read More

    email this       edit