控制台java application运行报错:
19:20:51,916 WARN RootClass:233 - composite-id class does not override equals(): com.mym.hibernate.model.StudentPK
(意思是:composite-id没有重写equals()方法,在com.num.hibernate.model.StudentPK)
Exception in thread "main" org.hibernate.MappingException: composite-id class must implement Serializable: com.mym.hibernate.model.StudentPK
(意思是:composite-id 必须实现Serializable接口,在com.mym.hibernate.model.StudentPK类中)
at org.hibernate.mapping.RootClass.checkCompositeIdentifier(RootClass.java:243)
at org.hibernate.mapping.RootClass.validate(RootClass.java:224)
at org.hibernate.cfg.Configuration.validate(Configuration.java:1149)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1334)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
19:20:51,918 WARN RootClass:238 - composite-id class does not override hashCode(): com.mym.hibernate.model.StudentPK
(意思是:composite-id没有重写hashCode()方法,在com.num.hibernate.model.StudentPK)
at com.mym.hibernate.model.StudentTest.beforeClass(StudentTest.java:16)
at com.mym.hibernate.model.StudentTest.main(StudentTest.java:41)
控制台报错:
17:56:09,344 WARN RootClass:233 - composite-id class does not override equals(): com.mym.hibernate.model.StudentPK
17:56:09,346 WARN RootClass:238 - composite-id class does not override hashCode(): com.mym.hibernate.model.StudentPK
Junit报错:
org.hibernate.MappingException: composite-id class must implement Serializable: com.mym.hibernate.model.StudentPK
(意思是:composite-id 必须实现Serializable接口,在com.mym.hibernate.model.StudentPK类中&#x