JPA Hibernate MappingException:未知实体

时间:2012-04-30 08:34:44

标签: hibernate jpa mapping

我创建了一个简单的CRUD应用程序,它使用了JPA和Hibernate。

我有实体注释JPA javax.persistence.@entity注释和hibernate配置文件(hibernate.cfg.xml)

我不使用JPA实体管理器而不是使用Hibernate Native API (Session, Session Factory, HibernateUtil)。 我没有hibernate映射文件和persistence.xml

有任何问题。

请帮忙。

1 个答案:

答案 0 :(得分:0)

在使用JPA注释时,您不需要拥有映射文件。但是当然你必须有persistence.xml,除非你使用的是Spring 3.1 LocalContainerEntityManagerFactoryBean类。