Hello, I'm developing my persistence layer in JBoss 7.1.1 Final, using EJB 3 + JPA, my problem is to inject the EntityManager object, because when I try to persist an entity, application returns "MySQLSyntaxErrorException error table 'mysquema.hibernate_sequence' doesn 't exist' ... " This happens when I get the EntityManager with annotation.
@ PersistenceContext (unitName = "mypu", type = PersistenceContextType.TRANSACTION)
But if I use,
EntityManagerFactory emf = Persistence
. createEntityManagerFactory ("mypu");
entityManager = emf.createEntityManager();
Everything works correctly.
PD. I use MySql and identifier of the entities have the annotation
@GeneratedValue (strategy = GenerationType.AUTO).
I'm guessing that you don't want @GeneratedValue(SEQUENCE), so switch to @GeneratedValue(TABLE). Or you could set property "
hibernate.id.new_generator_mappings=false" in your persistence.xml.
You can read more about the above property in this doc.