在applicationContext.xml中加入如下代码:
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.SQLServerDialect
</prop>
<prop key="hibernate.query.factory_class">
org.hibernate.hql.classic.ClassicQueryTranslatorFactory
</prop>
</props>
</property>
HQL语句:
String hql = "from Cheliang as t where t.cpHaoma like '"+cpHaoma+"'";
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.SQLServerDialect
</prop>
<prop key="hibernate.query.factory_class">
org.hibernate.hql.classic.ClassicQueryTranslatorFactory
</prop>
</props>
</property>
HQL语句:
String hql = "from Cheliang as t where t.cpHaoma like '"+cpHaoma+"'";