Delete remaining SimpleJdbcTemplate usage

This commit deletes all remaining usage of the deprecated
SimpleJdbcTemplate class within the framework itself.

Issue: SPR-11895
This commit is contained in:
Sam Brannen
2014-06-22 15:40:41 +02:00
parent 0c1249fe42
commit f1517f03ff
18 changed files with 156 additions and 167 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@ package org.springframework.orm.jpa;
import java.lang.reflect.Proxy;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.EntityNotFoundException;
import javax.persistence.FlushModeType;
@@ -144,7 +145,7 @@ public abstract class AbstractContainerEntityManagerFactoryIntegrationTests
protected final void insertPerson(String firstName) {
String INSERT_PERSON = "INSERT INTO PERSON (ID, FIRST_NAME, LAST_NAME) VALUES (?, ?, ?)";
simpleJdbcTemplate.update(INSERT_PERSON, 1, firstName, "Blair");
jdbcTemplate.update(INSERT_PERSON, 1, firstName, "Blair");
}
public void testEntityManagerProxyRejectsProgrammaticTxManagement() {

View File

@@ -26,6 +26,7 @@ import org.springframework.transaction.support.TransactionSynchronizationManager
* @author Rod Johnson
* @author Juergen Hoeller
*/
@SuppressWarnings("deprecation")
public abstract class AbstractEntityManagerFactoryIntegrationTests extends AbstractJpaTests {
public static final String[] ECLIPSELINK_CONFIG_LOCATIONS = new String[] {

View File

@@ -35,6 +35,7 @@ import org.springframework.transaction.annotation.Transactional;
* @author Rod Johnson
* @since 2.0
*/
@SuppressWarnings("deprecation")
public class ApplicationManagedEntityManagerIntegrationTests extends AbstractEntityManagerFactoryIntegrationTests {
@NotTransactional

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -36,6 +36,7 @@ import org.springframework.test.annotation.NotTransactional;
* @author Rod Johnson
* @since 2.0
*/
@SuppressWarnings("deprecation")
public class ContainerManagedEntityManagerIntegrationTests extends AbstractEntityManagerFactoryIntegrationTests {
@NotTransactional

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,6 +26,7 @@ import org.springframework.orm.jpa.EntityManagerFactoryInfo;
*
* @author Juergen Hoeller
*/
@SuppressWarnings("deprecation")
public class EclipseLinkEntityManagerFactoryIntegrationTests extends AbstractContainerEntityManagerFactoryIntegrationTests {
@Override

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -35,6 +35,7 @@ import org.springframework.test.annotation.IfProfileValue;
*/
// Essentially @Ignore-d since AnnotationBeanConfigurerAspect cannot be found
@IfProfileValue(name="test-group", value="broken")
@SuppressWarnings("deprecation")
public class HibernateEntityManagerFactoryIntegrationTests extends
AbstractContainerEntityManagerFactoryIntegrationTests {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,6 +26,7 @@ import org.springframework.orm.jpa.AbstractContainerEntityManagerFactoryIntegrat
*
* @author Juergen Hoeller
*/
@SuppressWarnings("deprecation")
public class HibernateMultiEntityManagerFactoryIntegrationTests extends
AbstractContainerEntityManagerFactoryIntegrationTests {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -37,6 +37,7 @@ import org.springframework.transaction.support.TransactionTemplate;
*
* @author Costin Leau
*/
@SuppressWarnings("deprecation")
public class OpenJpaEntityManagerFactoryIntegrationTests extends AbstractContainerEntityManagerFactoryIntegrationTests {
@Override

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2007 the original author or authors.
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,6 +27,7 @@ import org.springframework.orm.jpa.support.PersistenceInjectionTests.DefaultPubl
* @author Rod Johnson
* @author Juergen Hoeller
*/
@SuppressWarnings("deprecation")
public class PersistenceInjectionIntegrationTests extends AbstractEntityManagerFactoryIntegrationTests {
@Autowired

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,12 +20,9 @@ import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.Map;
import javax.sql.DataSource;
import junit.framework.AssertionFailedError;
import org.springframework.context.ApplicationContext;
import org.springframework.jdbc.core.simple.SimpleJdbcTemplate;
import org.springframework.test.AbstractTransactionalDataSourceSpringContextTests;
import org.springframework.transaction.TransactionDefinition;
import org.springframework.transaction.annotation.AnnotationTransactionAttributeSource;
@@ -35,8 +32,8 @@ import org.springframework.util.Assert;
/**
* <p>
* Java 5 specific subclass of
* {@link AbstractTransactionalDataSourceSpringContextTests}, exposing a
* {@link SimpleJdbcTemplate} and obeying annotations for transaction control.
* {@link AbstractTransactionalDataSourceSpringContextTests}, obeying annotations
* for transaction control.
* </p>
* <p>
* For example, test methods can be annotated with the regular Spring
@@ -74,8 +71,6 @@ import org.springframework.util.Assert;
public abstract class AbstractAnnotationAwareTransactionalTests extends
AbstractTransactionalDataSourceSpringContextTests {
protected SimpleJdbcTemplate simpleJdbcTemplate;
private final TransactionAttributeSource transactionAttributeSource = new AnnotationTransactionAttributeSource();
/**
@@ -109,13 +104,6 @@ public abstract class AbstractAnnotationAwareTransactionalTests extends
}
@Override
public void setDataSource(DataSource dataSource) {
super.setDataSource(dataSource);
// JdbcTemplate will be identically configured
this.simpleJdbcTemplate = new SimpleJdbcTemplate(this.jdbcTemplate);
}
/**
* Search for a unique {@link ProfileValueSource} in the supplied
* {@link ApplicationContext}. If found, the