Polishing
This commit is contained in:
parent
0204b082b1
commit
65ca7f4909
|
|
@ -2567,7 +2567,7 @@ public class DefaultListableBeanFactoryTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSingletonLookupByNameIsFastEnough() {
|
public void testSingletonLookupByNameIsFastEnough() {
|
||||||
// Assume.group(TestGroup.PERFORMANCE);
|
Assume.group(TestGroup.PERFORMANCE);
|
||||||
Assume.notLogging(factoryLog);
|
Assume.notLogging(factoryLog);
|
||||||
DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
|
DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
|
||||||
lbf.registerBeanDefinition("test", new RootBeanDefinition(TestBean.class));
|
lbf.registerBeanDefinition("test", new RootBeanDefinition(TestBean.class));
|
||||||
|
|
@ -2584,7 +2584,7 @@ public class DefaultListableBeanFactoryTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSingletonLookupByTypeIsFastEnough() {
|
public void testSingletonLookupByTypeIsFastEnough() {
|
||||||
// Assume.group(TestGroup.PERFORMANCE);
|
Assume.group(TestGroup.PERFORMANCE);
|
||||||
Assume.notLogging(factoryLog);
|
Assume.notLogging(factoryLog);
|
||||||
DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
|
DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
|
||||||
lbf.registerBeanDefinition("test", new RootBeanDefinition(TestBean.class));
|
lbf.registerBeanDefinition("test", new RootBeanDefinition(TestBean.class));
|
||||||
|
|
|
||||||
|
|
@ -26,12 +26,12 @@ import org.springframework.dao.InvalidDataAccessApiUsageException;
|
||||||
import org.springframework.lang.Nullable;
|
import org.springframework.lang.Nullable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default implementation of the {@link KeyHolder} interface, to be used for
|
* The standard implementation of the {@link KeyHolder} interface, to be used for
|
||||||
* holding auto-generated keys (as potentially returned by JDBC insert statements).
|
* holding auto-generated keys (as potentially returned by JDBC insert statements).
|
||||||
*
|
*
|
||||||
* <p>Create an instance of this class for each insert operation, and pass
|
* <p>Create an instance of this class for each insert operation, and pass it
|
||||||
* it to the corresponding {@link org.springframework.jdbc.core.JdbcTemplate}
|
* to the corresponding {@link org.springframework.jdbc.core.JdbcTemplate} or
|
||||||
* or {org.springframework.jdbc.object.SqlUpdate} methods.
|
* {@link org.springframework.jdbc.object.SqlUpdate} methods.
|
||||||
*
|
*
|
||||||
* @author Thomas Risberg
|
* @author Thomas Risberg
|
||||||
* @author Juergen Hoeller
|
* @author Juergen Hoeller
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2012 the original author or authors.
|
* Copyright 2002-2018 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -52,17 +52,17 @@ public interface KeyHolder {
|
||||||
* multiple entries as well. If this method encounters multiple entries in
|
* multiple entries as well. If this method encounters multiple entries in
|
||||||
* either the map or the list meaning that multiple keys were returned,
|
* either the map or the list meaning that multiple keys were returned,
|
||||||
* then an InvalidDataAccessApiUsageException is thrown.
|
* then an InvalidDataAccessApiUsageException is thrown.
|
||||||
* @return the generated key
|
* @return the generated key as a number
|
||||||
* @throws InvalidDataAccessApiUsageException if multiple keys are encountered.
|
* @throws InvalidDataAccessApiUsageException if multiple keys are encountered
|
||||||
*/
|
*/
|
||||||
@Nullable
|
@Nullable
|
||||||
Number getKey() throws InvalidDataAccessApiUsageException;
|
Number getKey() throws InvalidDataAccessApiUsageException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve the first map of keys. If there are multiple entries in the list
|
* Retrieve the first map of keys.
|
||||||
* (meaning that multiple rows had keys returned), then an
|
* <p>If there are multiple entries in the list (meaning that multiple rows
|
||||||
* InvalidDataAccessApiUsageException is thrown.
|
* had keys returned), then an InvalidDataAccessApiUsageException is thrown.
|
||||||
* @return the Map of generated keys
|
* @return the Map of generated keys for a single row
|
||||||
* @throws InvalidDataAccessApiUsageException if keys for multiple rows are encountered
|
* @throws InvalidDataAccessApiUsageException if keys for multiple rows are encountered
|
||||||
*/
|
*/
|
||||||
@Nullable
|
@Nullable
|
||||||
|
|
@ -70,10 +70,10 @@ public interface KeyHolder {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a reference to the List that contains the keys.
|
* Return a reference to the List that contains the keys.
|
||||||
* Can be used for extracting keys for multiple rows (an unusual case),
|
* <p>Can be used for extracting keys for multiple rows (an unusual case),
|
||||||
* and also for adding new maps of keys.
|
* and also for adding new maps of keys.
|
||||||
* @return the List for the generated keys, with each entry being a Map
|
* @return the List for the generated keys, with each entry representing
|
||||||
* of column names and key values
|
* an individual row through a Map of column names and key values
|
||||||
*/
|
*/
|
||||||
List<Map<String, Object>> getKeyList();
|
List<Map<String, Object>> getKeyList();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue