hibernate使用的是注解方式映射
Caused by: org.hibernate.DuplicateMappingException: duplicate import: TUser4 refers to both com.alcatel.cn.hibernate.ORMapping.onetomany.pojo.TUser4 and com.alcatel.cn.hibernate.chaper04.pojo.TUser4 (try using auto-import="false")
用这个就可以了:
@Entity(name="xxxx.xxxx.User")
...
public class User {
....
}
本文探讨了在使用Hibernate进行数据库映射时遇到的双重导入错误,并提供了有效的解决方案。

1889

被折叠的 条评论
为什么被折叠?



