I\'m new to JPA and I\'m having problems with the autogeneration of primary key values.
I have the following entity:
package jpatest.entities;
impor
As Charles pointed out in his answer, the problem is not the id generation, but the persistence layer not finding the entity.
As you, I am also new to JPA. I have tried to write a "Hello World" JPA application using org.eclipse.persistence.jpa.PersistenceProvider when I got this error. The mentioned workaround also worked for me. Moreover, through trial-error I also found that to declare your entities, you must always anotate @entity in each entity and:
exclude-unlisted-classes to true, you also have to list the entities within class elements in your persistence.xmlexclude-unlisted-classes to false the persistence layer can find the entities regardles of the class element in your persistence.xml.