首先说明,版本是: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了不懂为什么哪位帮帮忙啊。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货