下面代码里show_sql那行,我加上了,就提示如下错误:
Multiple annotations found at this line:
- No setter found for property 'show_sql' in class 
 'org.springframework.orm.hibernate3.LocalSessionFactoryBean'
- cvc-complex-type.2.3: Element 'property' cannot have character [children], because the 
 type's content type is element-only.
- <property> element for property 'show_sql' must specify a ref or value
不加那行代码就没事,这怎么改啊,总报错 <bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="show_sql">true</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.MySQLDialect
</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>com/zjm/study/vo/Codedb.hbm.xml</value>
<value>com/zjm/study/vo/Userdb.hbm.xml</value>
</list>
</property>
</bean>

解决方案 »

  1.   

    <property name="hibernateProperties">
    <props>
    <prop key="hibernate.dialect">
    org.hibernate.dialect.MySQLDialect
    </prop>
    <prop key="hibernate.show_sql">true</prop>
    </props>
    </property>
      

  2.   

     <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
       <property name="dataSource" ref="dataSource"></property>
       <property name="hibernateProperties">
         <props>
           <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
           <prop key="hibernate.show_sql">true</prop>
         </props>
       </property>
       <property name="mappingResources">
        <list>
          <value>com/test/bean/User.hbm.xml</value>
        </list>
       </property>
      </bean>