org.hibernate.hql.ast.QuerySyntaxException: SysDictionary is not mapped [from SysDictionary as model where model.typename=?]
说有个对象没映射 这个时候首现检查自己的HQL语句是否把form 后的类名(首字母大写)写成了表名 如果不是,那么原因很可能就是如下:
在Spring 配置文件中--applicationContext.xml
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource" ref="dataSource1"/> <property name="mappingResources"> <list> <!-- 会员管理 --> <value>com/lbw/member/bean/Member.hbm.xml</value> <value>com/lbw/member/bean/Membercard.hbm.xml</value> <value>com/lbw/member/bean/Membercomplain.hbm.xml</value> <value>com/lbw/member/bean/Memberrecharge.hbm.xml</value> <value>com/lbw/member/bean/Membecardroperate.hbm.xml</value> <value>com/lbw/member/bean/SysDictionary.hbm.xml</value> <!--在此处查看是否缺少了相应的映射文件--> </list> </property> <property name="hibernateProperties"><!--hibernateProperties文件特性配置--> <props> <prop key="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</prop> <prop key="hibernate.show_sql">true</prop> <prop key="hibernate.jdbc.batch_size">20</prop> </props> </property> </bean>