Upgraded dependency versions and minor polish
This commit is contained in:
78
build.gradle
78
build.gradle
@@ -11,7 +11,7 @@ buildscript {
|
||||
classpath 'io.spring.gradle:docbook-reference-plugin:0.3.1'
|
||||
classpath 'org.springframework.build.gradle:propdeps-plugin:0.0.7'
|
||||
classpath 'io.spring.gradle:spring-io-plugin:0.0.5.RELEASE'
|
||||
classpath "io.spring.gradle:dependency-management-plugin:0.5.1.RELEASE"
|
||||
classpath "io.spring.gradle:dependency-management-plugin:0.6.0.RELEASE"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,57 +42,57 @@ allprojects {
|
||||
|
||||
environmentProperty = project.hasProperty('environment') ? getProperty('environment') : 'hsql'
|
||||
|
||||
springVersionDefault = '4.0.5.RELEASE'
|
||||
springVersionDefault = '4.1.9.RELEASE'
|
||||
springVersion = project.hasProperty('springVersion') ? getProperty('springVersion') : springVersionDefault
|
||||
springRetryVersion = '1.1.0.RELEASE'
|
||||
springAmqpVersion = '1.3.3.RELEASE'
|
||||
springDataCommonsVersion = '1.8.0.RELEASE'
|
||||
springDataGemfireVersion = '1.4.0.RELEASE'
|
||||
springDataJpaVersion = '1.6.0.RELEASE'
|
||||
springDataMongodbVersion = '1.5.0.RELEASE'
|
||||
springDataNeo4jVersion = '3.1.0.RELEASE'
|
||||
springDataNeo4j4Version = '4.1.1.RELEASE'
|
||||
springIntegrationVersion = '4.0.1.RELEASE'
|
||||
springLdapVersion = '2.0.2.RELEASE'
|
||||
springRetryVersion = '1.1.2.RELEASE'
|
||||
springAmqpVersion = '1.4.6.RELEASE'
|
||||
springDataCommonsVersion = '1.9.4.RELEASE'
|
||||
springDataGemfireVersion = '1.5.4.RELEASE'
|
||||
springDataJpaVersion = '1.7.4.RELEASE'
|
||||
springDataMongodbVersion = '1.6.4.RELEASE'
|
||||
springDataNeo4jVersion = '3.2.4.RELEASE'
|
||||
springDataNeo4j4Version = '4.1.2.RELEASE'
|
||||
springIntegrationVersion = '4.1.8.RELEASE'
|
||||
springLdapVersion = '2.0.4.RELEASE'
|
||||
|
||||
activemqVersion = '5.13.2'
|
||||
aspectjVersion = '1.8.0'
|
||||
castorVersion = '1.3.2'
|
||||
commonsCollectionsVersion = '3.2.1'
|
||||
aspectjVersion = '1.8.8'
|
||||
castorVersion = '1.3.3'
|
||||
commonsCollectionsVersion = '3.2.2'
|
||||
commonsDdbcpVersion = '1.4'
|
||||
commonsIoVersion = '2.4'
|
||||
commonsLangVersion = '2.6'
|
||||
derbyVersion = '10.10.1.1'
|
||||
groovyVersion = '2.3.0'
|
||||
derbyVersion = '10.10.2.0'
|
||||
groovyVersion = '2.4.4'
|
||||
hamcrestVersion = '1.3'
|
||||
h2databaseVersion = '1.3.175'
|
||||
hibernateVersion = '4.2.12.Final'
|
||||
hibernateValidatorVersion = '4.3.1.Final'
|
||||
hsqldbVersion = '2.3.2'
|
||||
h2databaseVersion = '1.4.190'
|
||||
hibernateVersion = '4.3.11.Final'
|
||||
hibernateValidatorVersion = '5.1.3.Final'
|
||||
hsqldbVersion = '2.3.3'
|
||||
ibatisVersion = '2.3.4.726'
|
||||
jacksonVersion = '1.9.13'
|
||||
jackson2Version = "2.3.3"
|
||||
javaMailVersion = '1.4.7'
|
||||
jackson2Version = "2.4.6"
|
||||
javaMailVersion = '1.5.5'
|
||||
javaxBatchApiVersion = '1.0'
|
||||
javaxInjectVersion = '1'
|
||||
jbatchTckSpi = '1.0'
|
||||
jettisonVersion = '1.2'
|
||||
jtdsVersion = '1.2.4'
|
||||
jtdsVersion = '1.3.1'
|
||||
junitVersion = '4.11'
|
||||
log4jVersion = '1.2.17'
|
||||
mysqlVersion = '5.1.29'
|
||||
mockitoVersion = '1.9.5'
|
||||
postgresqlVersion = '9.0-801.jdbc4'
|
||||
quartzVersion = '2.2.1'
|
||||
mysqlVersion = '5.1.38'
|
||||
mockitoVersion = '1.10.19'
|
||||
postgresqlVersion = '9.4.1209.jre6'
|
||||
quartzVersion = '2.2.2'
|
||||
servletApiVersion = '3.0.1'
|
||||
slf4jVersion = '1.7.7'
|
||||
slf4jVersion = '1.7.21'
|
||||
sqlfireclientVersion = '1.0.3'
|
||||
sqliteVersion = '3.7.2'
|
||||
woodstoxVersion = '4.2.0'
|
||||
xercesVersion = '2.8.1'
|
||||
sqliteVersion = '3.8.11.2'
|
||||
woodstoxVersion = '4.2.1'
|
||||
xercesVersion = '2.11.0'
|
||||
xmlunitVersion = '1.5'
|
||||
xstreamVersion = '1.4.7'
|
||||
jrubyVersion = '1.7.22'
|
||||
xstreamVersion = '1.4.9'
|
||||
jrubyVersion = '1.7.23'
|
||||
beanshellVersion = '2.0b5'
|
||||
}
|
||||
}
|
||||
@@ -415,7 +415,7 @@ project('spring-batch-core-tests') {
|
||||
testCompile "org.springframework:spring-jdbc:$springVersion"
|
||||
|
||||
runtime "mysql:mysql-connector-java:$mysqlVersion"
|
||||
runtime "postgresql:postgresql:$postgresqlVersion"
|
||||
runtime "org.postgresql:postgresql:$postgresqlVersion"
|
||||
runtime "javax.batch:javax.batch-api:$javaxBatchApiVersion"
|
||||
|
||||
optional "org.aspectj:aspectjrt:$aspectjVersion"
|
||||
@@ -481,7 +481,7 @@ project('spring-batch-infrastructure-tests') {
|
||||
optional "org.springframework:spring-jms:$springVersion"
|
||||
|
||||
runtime "mysql:mysql-connector-java:$mysqlVersion"
|
||||
runtime "postgresql:postgresql:$postgresqlVersion"
|
||||
runtime "org.postgresql:postgresql:$postgresqlVersion"
|
||||
}
|
||||
test {
|
||||
enabled = project.hasProperty('alltests') ? true : false
|
||||
@@ -546,7 +546,7 @@ project('spring-batch-integration') {
|
||||
|
||||
optional "javax.jms:jms-api:1.1-rev-1"
|
||||
optional "org.slf4j:slf4j-log4j12:$slf4jVersion"
|
||||
optional "log4j:log4j:1.2.14"
|
||||
optional "log4j:log4j:$log4jVersion"
|
||||
optional "org.springframework.integration:spring-integration-jms:$springIntegrationVersion"
|
||||
optional "org.springframework:spring-jms:$springVersion"
|
||||
|
||||
@@ -613,7 +613,7 @@ project('spring-batch-samples') {
|
||||
optional "com.vmware.sqlfire:sqlfireclient:$sqlfireclientVersion"
|
||||
optional "org.slf4j:slf4j-log4j12:$slf4jVersion"
|
||||
optional "org.apache.derby:derby:$derbyVersion"
|
||||
optional "postgresql:postgresql:$postgresqlVersion"
|
||||
optional "org.postgresql:postgresql:$postgresqlVersion"
|
||||
optional "org.springframework:spring-web:$springVersion"
|
||||
optional "org.springframework.data:spring-data-commons:$springDataCommonsVersion"
|
||||
optional "org.springframework.amqp:spring-amqp:$springAmqpVersion"
|
||||
@@ -840,5 +840,5 @@ or specify the Gradle property `TCK_HOME`, e.g: ./gradlew runTck -PTCK_HOME=/pat
|
||||
|
||||
task wrapper(type: Wrapper) {
|
||||
description = 'Generates gradlew[.bat] scripts'
|
||||
gradleVersion = '2.12'
|
||||
gradleVersion = '2.14.1'
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ import org.springframework.core.io.Resource;
|
||||
*
|
||||
* @deprecated use {@link GenericApplicationContextFactory} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public class ClassPathXmlApplicationContextFactory extends GenericApplicationContextFactory {
|
||||
|
||||
/**
|
||||
|
||||
@@ -22,6 +22,7 @@ package org.springframework.batch.core.configuration.support;
|
||||
*
|
||||
* @deprecated in version 2.1, please us {@link AutomaticJobRegistrar} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public abstract class ClassPathXmlJobRegistry {
|
||||
|
||||
}
|
||||
|
||||
@@ -161,7 +161,7 @@ public class SimpleFlowFactoryBean implements FactoryBean<SimpleFlow>, Initializ
|
||||
* @param state The state that will be used to create the StepState
|
||||
* @param oldName The name to be replaced
|
||||
* @param stateName The name for the new State
|
||||
* @return
|
||||
* @return a state for the requested data
|
||||
*/
|
||||
protected State createNewStepState(State state, String oldName,
|
||||
String stateName) {
|
||||
|
||||
@@ -15,15 +15,15 @@
|
||||
*/
|
||||
package org.springframework.batch.core.explore;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.springframework.batch.core.JobExecution;
|
||||
import org.springframework.batch.core.JobInstance;
|
||||
import org.springframework.batch.core.StepExecution;
|
||||
import org.springframework.batch.core.launch.NoSuchJobException;
|
||||
import org.springframework.batch.item.ExecutionContext;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Entry point for browsing executions of running or historical jobs and steps.
|
||||
* Since the data may be re-hydrated from persistent storage, it may not contain
|
||||
@@ -116,7 +116,7 @@ public interface JobExplorer {
|
||||
* @param jobName
|
||||
* @param start
|
||||
* @param count
|
||||
* @return
|
||||
* @return a list of {@link JobInstance} for the job name requested
|
||||
*/
|
||||
List<JobInstance> findJobInstancesByJobName(String jobName, int start, int count);
|
||||
|
||||
|
||||
@@ -135,7 +135,7 @@ public class JobFlowExecutor implements FlowExecutor {
|
||||
|
||||
/**
|
||||
* @param status
|
||||
* @return
|
||||
* @return A {@link BatchStatus} appropriate for the {@link FlowExecutionStatus} provided
|
||||
*/
|
||||
protected BatchStatus findBatchStatus(FlowExecutionStatus status) {
|
||||
for (BatchStatus batchStatus : BatchStatus.values()) {
|
||||
|
||||
@@ -71,6 +71,7 @@ public class StepState extends AbstractState implements StepLocator, StepHolder
|
||||
* @deprecated in favor of using {@link StepLocator#getStep(String)}.
|
||||
*/
|
||||
@Override
|
||||
@Deprecated
|
||||
public Step getStep() {
|
||||
return step;
|
||||
}
|
||||
|
||||
@@ -357,7 +357,7 @@ public class JdbcJobExecutionDao extends AbstractJdbcBatchMetadataDao implements
|
||||
|
||||
/**
|
||||
* @param executionId
|
||||
* @return
|
||||
* @return job parameters for the requested execution id
|
||||
*/
|
||||
protected JobParameters getJobParameters(Long executionId) {
|
||||
final Map<String, JobParameter> map = new HashMap<String, JobParameter>();
|
||||
|
||||
@@ -104,7 +104,7 @@ public interface JobInstanceDao {
|
||||
* @param jobName
|
||||
* @param start
|
||||
* @param count
|
||||
* @return
|
||||
* @return a list of {@link JobInstance} for the job name requested.
|
||||
*/
|
||||
List<JobInstance> findJobInstancesByName(String jobName, int start, int count);
|
||||
|
||||
|
||||
@@ -149,6 +149,7 @@ public abstract class AbstractJobRepositoryFactoryBean implements FactoryBean<Jo
|
||||
* @throws Exception if the repository could not be created
|
||||
* @deprecated use {@link #getObject()} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public JobRepository getJobRepository() throws Exception {
|
||||
return getObject();
|
||||
}
|
||||
|
||||
@@ -16,8 +16,13 @@
|
||||
|
||||
package org.springframework.batch.core.repository.support;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.sql.Types;
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.springframework.batch.core.repository.ExecutionContextSerializer;
|
||||
import org.springframework.batch.core.repository.dao.AbstractJdbcBatchMetadataDao;
|
||||
import org.springframework.batch.core.repository.dao.ExecutionContextDao;
|
||||
@@ -36,15 +41,11 @@ import org.springframework.beans.factory.FactoryBean;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.jdbc.core.JdbcOperations;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.jdbc.support.lob.DefaultLobHandler;
|
||||
import org.springframework.jdbc.support.lob.LobHandler;
|
||||
import org.springframework.jdbc.support.lob.OracleLobHandler;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
import java.lang.reflect.Field;
|
||||
import java.sql.Types;
|
||||
|
||||
import static org.springframework.batch.support.DatabaseType.SYBASE;
|
||||
|
||||
/**
|
||||
@@ -184,7 +185,7 @@ public class JobRepositoryFactoryBean extends AbstractJobRepositoryFactoryBean i
|
||||
}
|
||||
|
||||
if (lobHandler == null && databaseType.equalsIgnoreCase(DatabaseType.ORACLE.toString())) {
|
||||
lobHandler = new OracleLobHandler();
|
||||
lobHandler = new DefaultLobHandler();
|
||||
}
|
||||
|
||||
if(serializer == null) {
|
||||
|
||||
@@ -15,6 +15,12 @@
|
||||
*/
|
||||
package org.springframework.batch.core.step.builder;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import org.springframework.batch.core.ChunkListener;
|
||||
import org.springframework.batch.core.ItemProcessListener;
|
||||
import org.springframework.batch.core.ItemReadListener;
|
||||
@@ -47,12 +53,6 @@ import org.springframework.batch.repeat.support.RepeatTemplate;
|
||||
import org.springframework.batch.support.ReflectionUtils;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Step builder for simple item processing (chunk oriented) steps. Items are read and cached in chunks, and then
|
||||
* processed (transformed) and written (optionally either the processor or the writer can be omitted) all in the same
|
||||
@@ -111,8 +111,7 @@ public class SimpleStepBuilder<I, O> extends AbstractTaskletStepBuilder<SimpleSt
|
||||
}
|
||||
|
||||
public FaultTolerantStepBuilder<I, O> faultTolerant() {
|
||||
FaultTolerantStepBuilder<I, O> builder = new FaultTolerantStepBuilder<I, O>(this);
|
||||
return builder;
|
||||
return new FaultTolerantStepBuilder<I, O>(this);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -248,6 +247,7 @@ public class SimpleStepBuilder<I, O> extends AbstractTaskletStepBuilder<SimpleSt
|
||||
* @param listener the object that has a method configured with listener annotation
|
||||
* @return this for fluent chaining
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public SimpleStepBuilder listener(Object listener) {
|
||||
super.listener(listener);
|
||||
|
||||
@@ -15,23 +15,16 @@
|
||||
*/
|
||||
package org.springframework.batch.core.repository.support;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.DatabaseMetaData;
|
||||
import java.sql.Types;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.batch.core.JobParameters;
|
||||
import org.springframework.batch.core.repository.ExecutionContextSerializer;
|
||||
import org.springframework.batch.core.repository.JobRepository;
|
||||
@@ -45,11 +38,17 @@ import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer;
|
||||
import org.springframework.jdbc.support.lob.DefaultLobHandler;
|
||||
import org.springframework.jdbc.support.lob.LobHandler;
|
||||
import org.springframework.jdbc.support.lob.OracleLobHandler;
|
||||
import org.springframework.test.util.ReflectionTestUtils;
|
||||
import org.springframework.transaction.PlatformTransactionManager;
|
||||
import org.springframework.transaction.support.DefaultTransactionDefinition;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
/**
|
||||
* @author Lucas Ward
|
||||
* @author Will Schipp
|
||||
@@ -115,7 +114,7 @@ public class JobRepositoryFactoryBeanTests {
|
||||
|
||||
factory.afterPropertiesSet();
|
||||
LobHandler lobHandler = (LobHandler) ReflectionTestUtils.getField(factory, "lobHandler");
|
||||
assertTrue(lobHandler instanceof OracleLobHandler);
|
||||
assertTrue(lobHandler instanceof DefaultLobHandler);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -15,9 +15,27 @@
|
||||
*/
|
||||
package org.springframework.batch.core.step.builder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.batch.core.*;
|
||||
import org.springframework.batch.core.annotation.*;
|
||||
|
||||
import org.springframework.batch.core.BatchStatus;
|
||||
import org.springframework.batch.core.ExitStatus;
|
||||
import org.springframework.batch.core.JobParameters;
|
||||
import org.springframework.batch.core.StepContribution;
|
||||
import org.springframework.batch.core.StepExecution;
|
||||
import org.springframework.batch.core.StepExecutionListener;
|
||||
import org.springframework.batch.core.annotation.AfterChunk;
|
||||
import org.springframework.batch.core.annotation.AfterProcess;
|
||||
import org.springframework.batch.core.annotation.AfterRead;
|
||||
import org.springframework.batch.core.annotation.AfterStep;
|
||||
import org.springframework.batch.core.annotation.AfterWrite;
|
||||
import org.springframework.batch.core.annotation.BeforeChunk;
|
||||
import org.springframework.batch.core.annotation.BeforeProcess;
|
||||
import org.springframework.batch.core.annotation.BeforeRead;
|
||||
import org.springframework.batch.core.annotation.BeforeStep;
|
||||
import org.springframework.batch.core.annotation.BeforeWrite;
|
||||
import org.springframework.batch.core.configuration.xml.DummyItemWriter;
|
||||
import org.springframework.batch.core.repository.JobRepository;
|
||||
import org.springframework.batch.core.repository.support.MapJobRepositoryFactoryBean;
|
||||
@@ -30,9 +48,6 @@ import org.springframework.batch.repeat.RepeatStatus;
|
||||
import org.springframework.batch.support.transaction.ResourcelessTransactionManager;
|
||||
import org.springframework.transaction.PlatformTransactionManager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
/**
|
||||
@@ -63,7 +78,7 @@ public class StepBuilderTests {
|
||||
|
||||
@Test
|
||||
public void testListeners() throws Exception {
|
||||
JobRepository jobRepository = new MapJobRepositoryFactoryBean().getJobRepository();
|
||||
JobRepository jobRepository = new MapJobRepositoryFactoryBean().getObject();
|
||||
StepExecution execution = jobRepository.createJobExecution("foo", new JobParameters()).createStepExecution("step");
|
||||
jobRepository.add(execution);
|
||||
PlatformTransactionManager transactionManager = new ResourcelessTransactionManager();
|
||||
@@ -89,7 +104,7 @@ public class StepBuilderTests {
|
||||
|
||||
@Test
|
||||
public void testItemListeners() throws Exception {
|
||||
JobRepository jobRepository = new MapJobRepositoryFactoryBean().getJobRepository();
|
||||
JobRepository jobRepository = new MapJobRepositoryFactoryBean().getObject();
|
||||
StepExecution execution = jobRepository.createJobExecution("foo", new JobParameters()).createStepExecution("step");
|
||||
jobRepository.add(execution);
|
||||
PlatformTransactionManager transactionManager = new ResourcelessTransactionManager();
|
||||
|
||||
@@ -146,7 +146,7 @@ public class ExtendedConnectionDataSourceProxy implements SmartDataSource, Initi
|
||||
if (connection == null) {
|
||||
return false;
|
||||
}
|
||||
return connection.equals(closeSuppressedConnection) ? true : false;
|
||||
return connection.equals(closeSuppressedConnection);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -210,8 +210,8 @@ public class ExtendedConnectionDataSourceProxy implements SmartDataSource, Initi
|
||||
else {
|
||||
target = dataSource.getConnection();
|
||||
}
|
||||
Connection connection = getCloseSuppressingConnectionProxy(target);
|
||||
return connection;
|
||||
|
||||
return getCloseSuppressingConnectionProxy(target);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -72,6 +72,7 @@ public class HibernateItemWriter<T> implements ItemWriter<T>, InitializingBean {
|
||||
* the hibernateTemplate to set
|
||||
* @deprecated As of 2.2 in favor of using Hibernate's session management APIs directly
|
||||
*/
|
||||
@Deprecated
|
||||
public void setHibernateTemplate(HibernateOperations hibernateTemplate) {
|
||||
this.hibernateTemplate = hibernateTemplate;
|
||||
}
|
||||
@@ -159,6 +160,7 @@ public class HibernateItemWriter<T> implements ItemWriter<T>, InitializingBean {
|
||||
* the list of items to use for the write
|
||||
* @deprecated As of 2.2 in favor of using Hibernate's session management APIs directly
|
||||
*/
|
||||
@Deprecated
|
||||
protected void doWrite(HibernateOperations hibernateTemplate,
|
||||
List<? extends T> items) {
|
||||
|
||||
|
||||
@@ -15,8 +15,16 @@
|
||||
*/
|
||||
package org.springframework.batch.item.database;
|
||||
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.springframework.batch.item.ItemWriter;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.dao.DataAccessException;
|
||||
@@ -28,13 +36,6 @@ import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
|
||||
import org.springframework.jdbc.core.namedparam.SqlParameterSource;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>{@link ItemWriter} that uses the batching features from
|
||||
* {@link NamedParameterJdbcTemplate} to execute a batch of statements for all items
|
||||
@@ -167,11 +168,11 @@ public class JdbcBatchItemWriter<T> implements ItemWriter<T>, InitializingBean {
|
||||
logger.debug("Executing batch with " + items.size() + " items.");
|
||||
}
|
||||
|
||||
int[] updateCounts = null;
|
||||
int[] updateCounts;
|
||||
|
||||
if (usingNamedParameters) {
|
||||
if(items.get(0) instanceof Map) {
|
||||
updateCounts = namedParameterJdbcTemplate.batchUpdate(sql, items.toArray(new Map[0]));
|
||||
updateCounts = namedParameterJdbcTemplate.batchUpdate(sql, items.toArray(new Map[items.size()]));
|
||||
} else {
|
||||
SqlParameterSource[] batchArgs = new SqlParameterSource[items.size()];
|
||||
int i = 0;
|
||||
|
||||
@@ -16,9 +16,6 @@
|
||||
|
||||
package org.springframework.batch.item.file.transform;
|
||||
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.DateFormat;
|
||||
import java.text.DecimalFormat;
|
||||
@@ -31,6 +28,9 @@ import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* Default implementation of {@link FieldSet} using Java using Java primitive
|
||||
* and standard types and utilities. Strings are trimmed before parsing by
|
||||
@@ -90,7 +90,7 @@ public class DefaultFieldSet implements FieldSet {
|
||||
* @see FieldSet#readString(int)
|
||||
*/
|
||||
public DefaultFieldSet(String[] tokens) {
|
||||
this.tokens = tokens == null ? null : (String[]) tokens.clone();
|
||||
this.tokens = tokens == null ? null : tokens.clone();
|
||||
setNumberFormat(NumberFormat.getInstance(Locale.US));
|
||||
}
|
||||
|
||||
@@ -228,7 +228,7 @@ public class DefaultFieldSet implements FieldSet {
|
||||
|
||||
String value = readAndTrim(index);
|
||||
|
||||
return trueValue.equals(value) ? true : false;
|
||||
return trueValue.equals(value);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -718,8 +718,8 @@ public class DefaultFieldSet implements FieldSet {
|
||||
|
||||
int result = 1;
|
||||
|
||||
for (int i = 0; i < tokens.length; i++) {
|
||||
result = 31 * result + (tokens[i] == null ? 0 : tokens[i].hashCode());
|
||||
for (String token : tokens) {
|
||||
result = 31 * result + (token == null ? 0 : token.hashCode());
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
@@ -97,6 +97,7 @@ public final class FileUtils {
|
||||
/**
|
||||
* @deprecated use the version with explicit append parameter instead. Here append=false is assumed.
|
||||
*/
|
||||
@Deprecated
|
||||
public static void setUpOutputFile(File file, boolean restarted, boolean overwriteOutputFile) {
|
||||
setUpOutputFile(file, restarted, false, overwriteOutputFile);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ package org.springframework.batch.integration.chunk;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.integration.annotation.Header;
|
||||
import org.springframework.messaging.handler.annotation.Header;
|
||||
import org.springframework.integration.jms.JmsHeaders;
|
||||
|
||||
/**
|
||||
|
||||
@@ -15,9 +15,6 @@
|
||||
*/
|
||||
package org.springframework.batch.integration.async;
|
||||
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Callable;
|
||||
@@ -29,6 +26,7 @@ import org.junit.rules.MethodRule;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.model.FrameworkMethod;
|
||||
import org.junit.runners.model.Statement;
|
||||
|
||||
import org.springframework.batch.core.JobParametersBuilder;
|
||||
import org.springframework.batch.core.StepExecution;
|
||||
import org.springframework.batch.item.ItemProcessor;
|
||||
@@ -36,12 +34,15 @@ import org.springframework.batch.test.MetaDataInstanceFactory;
|
||||
import org.springframework.batch.test.StepScopeTestUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.core.task.SimpleAsyncTaskExecutor;
|
||||
import org.springframework.integration.annotation.Header;
|
||||
import org.springframework.integration.annotation.MessageEndpoint;
|
||||
import org.springframework.integration.annotation.ServiceActivator;
|
||||
import org.springframework.messaging.handler.annotation.Header;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration
|
||||
public class PollingAsyncItemProcessorMessagingGatewayTests {
|
||||
|
||||
Reference in New Issue
Block a user