1 Reply Latest reply on Nov 9, 2012 2:14 PM by Scott Marlow

    Problem with EntityManager and Hibernate.

    Raul Alvarez Newbie

      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).