解决办法:
1.确保注释是javax.persistence.entity,不org.hibernate.annotations.entity。
2.如果你是手动列出你的实体(在persistence.xml,在hibernate.cfg.xml,或在配置您的会话工厂),然后确保你还列出实体
3.确保你没有多XX类在不同的包,你输入错了。(重点)
解决办法:
1.确保注释是javax.persistence.entity,不org.hibernate.annotations.entity。
2.如果你是手动列出你的实体(在persistence.xml,在hibernate.cfg.xml,或在配置您的会话工厂),然后确保你还列出实体
3.确保你没有多XX类在不同的包,你输入错了。(重点)
转载于:https://my.oschina.net/gaomq/blog/915658