hibernate annotation 的错误。。求救啊。。。
无痕叶落 2010-08-04 04:09:15 首先说明,版本是:hibernate3.5.4
在映射时,我有两个类:Student 和 Teacher,Student用xml映射,Teacher用annotation映射
刚开始,在只有student一个类时,运行没问题,如果加入teacher类后,运行StudentTest就会出错:
Exception in thread "main" org.hibernate.MappingException: An AnnotationConfiguration instance is required to use <mapping class="helloworld.model.Teacher"/>
如果把配置文件中的 <mapping class="helloworld.model.Teacher"/> 去掉,那StudentTest运行就OK了。。。
不懂为什么。。。哪位帮帮忙啊。。。。