处理文件后如何在spring集成处理后移动文件..?我已经按照 http://xpadro.blogspot.com/2016/07/spring-integration-polling-file.html 来实现文件轮询,但我需要添加onSuccess和OnError跨国事件(没有XML配置)
我们正在构建一个应用程序,我们需要将实体更新记录到历史记录表中。我正在尝试通过休眠拦截器来实现这一点,我们可以设法获取所有更改,但在将它们插入审计表时遇到困难。
我的 JPA 配置
public class JPAConfiguration {
----
@Bean(name = "entityManagerFactory")
public LocalContainerEntityManagerFactoryBean entityManagerFactoryBean() throws SQLException {
LocalContainerEntityManagerFactoryBean factoryBean = new LocalContainerEntityManagerFactoryBean();
factoryBean.setDataSource(dataSource());
factoryBean.setPackagesToScan(new String[] {"com.yyy.persist"});
HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
vendorAdapter.setShowSql(true);
// thsi is required in order to enable Query DSL
vendorAdapter.setDatabasePlatform("org.hibernate.dialect.Oracle10gDialect");
factoryBean.setJpaVendorAdapter(vendorAdapter);
// factoryBean.setMappingResources(mappingResources);
// adding hibernate interceptor
Properties jpaProperties = new Properties();
jpaProperties.setProperty("hibernate.ejb.interceptor", "com.yyy.admin.service.AuditInterceptor");
factoryBean.setJpaProperties(jpaProperties);
return factoryBean;
}
Run Code Online (Sandbox Code Playgroud)
我的拦截器
public class AuditInterceptor extends EmptyInterceptor {
public boolean onFlushDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState,
String[] …Run Code Online (Sandbox Code Playgroud)