package com.em;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
public class EntityManagerClass {
public static EntityManager createEntity() {
System.out.println("EntityManager start");
**EntityManagerFactory entityManagerFactory = Persistence.createEntityManagerFactory("idata");**
EntityManager entityManager = entityManagerFactory.createEntityManager();
System.out.println("EntityManager"+entityManager);
return entityManager;
}
}
嗨,我是 java 新手。当我在 JPA 中使用 ENTITYMANAGERFACTORY 时,我收到类似“线程中的异常”AWT-EventQueue-0“java.lang.IncompatibleClassChangeError:实现类”的错误。请帮助解决这个问题。