【发布时间】:2017-06-12 21:28:13
【问题描述】:
我需要在休眠中禁用 ONLY_FULL_GROUP_BY。 这是我当前的会话工厂。 我不确定如何在此指定 sql_mode=''。
<bean id="eAgilitySessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="eAgilitysDataSource"/>
<property name="configLocation">
<value>classpath:hibernate.cfg.xml</value>
</property>
<property name="configurationClass">
<value>org.hibernate.cfg.AnnotationConfiguration</value>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${mysql.dialect}</prop>
<prop key="hibernate.show_sql">false</prop>
<prop key="hibernate.connection.useUnicode">true</prop>
<prop key="hibernate.connection.characterEncoding">UTF-8</prop>
<prop key="hibernate.connection.charSet">UTF-8</prop>
<prop key="hibernate.connection.url">${dwh.db.url}</prop>
<prop key="hibernate.connection.driver_class">com.mysql.jdbc.Driver</prop>
</props>
</property>
</bean>
【问题讨论】:
标签: java mysql hibernate group-by