org.hibernate.AnnotationException

org.hibernate.AnnotationException: No identifier specified for entity: com.along.entity.emp

你是否也像我一样,因为注释的包错误,而找了近两个小时的程序问题呢

原因:  没有给实体类ID

解决方案:  加入@Id注释  这里不是spring的@Id,否则报错

猜你喜欢

转载自www.cnblogs.com/alongg/p/12918896.html