public void deleteUser(User user)
{
//User user = (User)this.hibernateTemplate.load(User.class, id);
System.out.println(user.getEmail()+"----------ryrty----delete---hibernatetemplate:"+this.hibernateTemplate);
this.getHibernateTemplate().delete(user);
System.out.println("-----------------------------delete");
}下面是控制台打印
dfsdf----------ryrty----delete----------hibernatetemplate:org.springframework.orm.hibernate3.HibernateTemplate@13ac14d
-----------------------------deletethis.getHibernateTemplate().delete(user);这一句像没事发生的一样,搞了几天了
大哥,大姐们帮帮忙
{
//User user = (User)this.hibernateTemplate.load(User.class, id);
System.out.println(user.getEmail()+"----------ryrty----delete---hibernatetemplate:"+this.hibernateTemplate);
this.getHibernateTemplate().delete(user);
System.out.println("-----------------------------delete");
}下面是控制台打印
dfsdf----------ryrty----delete----------hibernatetemplate:org.springframework.orm.hibernate3.HibernateTemplate@13ac14d
-----------------------------deletethis.getHibernateTemplate().delete(user);这一句像没事发生的一样,搞了几天了
大哥,大姐们帮帮忙
解决方案 »
- 学习hibernate时出现的问题
- No WebApplicationContext found: no ContextLoaderListener registered?
- 整合ssh问题
- 2个基本小问题
- extjs 保存状态问题
- Internet Explorer 末日
- Hibernate配置问题:“严重: problem parsing configuration/hibernate.cfg.xml”
- 想自己做个项目,高手给点意见.(up有分)
- 高手请进!!把jtable的数据保存为excel格式!怎么做?
- 可复用的EJB构件
- 关于HttpClient4.0的POST登录问题
- SSH<s:action>疑问
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref local="sessionFactory" />
</property>
</bean>
<bean id="baseTxProxy" lazy-init="true"
class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"
abstract="true">
<property name="transactionManager">
<ref bean="transactionManager" />
</property>
<property name="transactionAttributes">
<props>
<prop key="save*">PROPAGATION_REQUIRED</prop>
<prop key="update*">PROPAGATION_REQUIRED</prop>
<prop key="remove*">PROPAGATION_REQUIRED</prop>
<prop key="*">PROPAGATION_REQUIRED,readOnly</prop>
</props>
</property>
</bean>
请求前辈拍砖!!!!
只读???
试过了还是没用
都试了,这个本来就没有的,没办法加了也没用,不加也一样,就是没反应.
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"
default-lazy-init="true">
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>WEB-INF/conf/prop/db.properties</value>
</list>
</property>
</bean>
<context:component-scan base-package="com.disk" /> <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
<property name="driverClass" value="${test.driver}"/>
<property name="jdbcUrl" value="${test.url}"/>
<property name="properties">
<props>
<prop key="c3p0.minPoolSize">10</prop>
<prop key="hc3p0.maxPoolSize">1000</prop>
<prop key="hc3p0.timeout">6000</prop>
<prop key="c3p0.max_statement">100</prop>
<prop key="user">${test.username}</prop>
<prop key="password">${test.passwd}</prop>
</props>
</property>
</bean> <bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource">
<ref local="dataSource"/>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${test.dialect}</prop>
<prop key="hibernate.query.substitutions">true=1 false=0</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
<prop key="connection.pool_size">${test.maxActive}</prop>
<prop key="current_session_context_class">thread</prop>
<prop key="connection.autocommit">true</prop>
<prop key="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</prop>
<prop key="hibernate.cache.provider_configuration_file_resource_path">WEB-INF/conf/prop/ehcache-hibernate-local.xml</prop>
</props>
</property>
<property name="packagesToScan" value="com.disk.domain" />
</bean>
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref local="sessionFactory" />
</property>
</bean>
<bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate">
<property name="sessionFactory">
<ref local="sessionFactory"/>
</property>
</bean>
<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
<property name="dataSource">
<ref local="dataSource"/>
</property>
</bean>
<bean id="baseTxProxy" lazy-init="true"
class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"
abstract="true">
<property name="transactionManager">
<ref bean="transactionManager" />
</property>
<property name="transactionAttributes">
<props>
<prop key="save*">PROPAGATION_REQUIRED</prop>
<prop key="update*">PROPAGATION_REQUIRED</prop>
<prop key="remove*">PROPAGATION_REQUIRED</prop>
<prop key="delete*">PROPAGATION_REQUIRED</prop>
<prop key="*">PROPAGATION_REQUIRED,readOnly</prop>
</props>
</property>
</bean>
</beans>