JAVA认证:Spring和Hibernate整合时HQL查询语句乱码
来源:优易学  2011-4-30 9:58:29   【优易学:中国教育考试门户网】   资料下载   IT书店
  只需在配置文件ApplicationContext.xml。
  <bean id="sessionFactory"
  class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"
  destroy-method="destroy" >
  <property name="dataSource" ref="dataSource" />
  <property name="mappingResources">
  <list>
  <value>com/snsoft/crm/domain/SnRukudan.hbm.xml</value>
  <value>com/snsoft/crm/domain/SnKehu.hbm.xml</value
  </list>
  </property>
  <property name="hibernateProperties">
  <props>
  <prop key="hibernate.query.factory_class">
  org.hibernate.hql.classic.ClassicQueryTranslatorFactory
  </prop>
  <prop key="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</prop>
  <prop key="hibernate.show_sql">false</prop>
  </props>
  </property> </bean>

责任编辑:小草

文章搜索:
 相关文章
热点资讯
资讯快报
热门课程培训