diff --git a/CI.adoc b/CI.adoc index 8d895fc5d..aba8edf12 100644 --- a/CI.adoc +++ b/CI.adoc @@ -8,7 +8,7 @@ image:https://jenkins.spring.io/buildStatus/icon?job=spring-data-jdbc%2F1.0.x&su Since this pipeline is purely Docker-based, it's easy to: * Debug what went wrong on your local machine. -* Test out a a tweak to your `test.sh` script before sending it out. +* Test out a tweak to your `test.sh` script before sending it out. * Experiment against a new image before submitting your pull request. All of these use cases are great reasons to essentially run what the CI server does on your local machine. diff --git a/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/core/convert/DataAccessStrategy.java b/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/core/convert/DataAccessStrategy.java index ef829e037..ea5dd2be1 100644 --- a/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/core/convert/DataAccessStrategy.java +++ b/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/core/convert/DataAccessStrategy.java @@ -139,7 +139,7 @@ public interface DataAccessStrategy extends RelationResolver { * passed in matches the number of entities returned. * * @param ids the Ids of the entities to load. Must not be {@code null}. - * @param domainType the type of entities to laod. Must not be {@code null}. + * @param domainType the type of entities to load. Must not be {@code null}. * @param type of entities to load. * @return the loaded entities. Guaranteed to be not {@code null}. */ diff --git a/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/core/convert/IterableOfEntryToMapConverter.java b/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/core/convert/IterableOfEntryToMapConverter.java index bec55687c..30db6e7ad 100644 --- a/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/core/convert/IterableOfEntryToMapConverter.java +++ b/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/core/convert/IterableOfEntryToMapConverter.java @@ -54,7 +54,7 @@ class IterableOfEntryToMapConverter implements ConditionalConverter, Converter additonalValues; + private final Map additionalValues; public MyBatisContext(@Nullable Object id, @Nullable Object instance, @Nullable Class domainType, - Map additonalValues) { + Map additionalValues) { this.id = id; this.identifier = null; this.instance = instance; this.domainType = domainType; - this.additonalValues = additonalValues; + this.additionalValues = additionalValues; } public MyBatisContext(Identifier identifier, @Nullable Object instance, @Nullable Class domainType) { @@ -53,7 +53,7 @@ public class MyBatisContext { this.identifier = identifier; this.instance = instance; this.domainType = domainType; - this.additonalValues = Collections.emptyMap(); + this.additionalValues = Collections.emptyMap(); } /** @@ -104,7 +104,7 @@ public class MyBatisContext { */ @Nullable public Object get(String key) { - return additonalValues.get(key); + return additionalValues.get(key); } } diff --git a/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/repository/config/ConfigurableRowMapperMap.java b/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/repository/config/ConfigurableRowMapperMap.java index fc4eec17e..a71c19929 100644 --- a/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/repository/config/ConfigurableRowMapperMap.java +++ b/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/repository/config/ConfigurableRowMapperMap.java @@ -46,7 +46,7 @@ public class ConfigurableRowMapperMap implements RowMapperMap { } /** - * Returs a {@link RowMapper} for the given type if such a {@link RowMapper} is present. If an exact match is found + * Returns a {@link RowMapper} for the given type if such a {@link RowMapper} is present. If an exact match is found * that is returned. If not a {@link RowMapper} is returned that produces subtypes of the requested type. If no such * {@link RowMapper} is found the method returns {@code null}. * diff --git a/spring-data-jdbc/src/test/java/org/springframework/data/jdbc/core/JdbcAggregateTemplateUnitTests.java b/spring-data-jdbc/src/test/java/org/springframework/data/jdbc/core/JdbcAggregateTemplateUnitTests.java index 355ef8594..40fe4b296 100644 --- a/spring-data-jdbc/src/test/java/org/springframework/data/jdbc/core/JdbcAggregateTemplateUnitTests.java +++ b/spring-data-jdbc/src/test/java/org/springframework/data/jdbc/core/JdbcAggregateTemplateUnitTests.java @@ -88,7 +88,7 @@ public class JdbcAggregateTemplateUnitTests { } @Test // DATAJDBC-378 - public void findAllByIdWithEmpthListMustReturnEmptyResult() { + public void findAllByIdWithEmptyListMustReturnEmptyResult() { assertThat(template.findAllById(emptyList(), SampleEntity.class)).isEmpty(); } diff --git a/spring-data-jdbc/src/test/java/org/springframework/data/jdbc/repository/JdbcRepositoryResultSetExtractorIntegrationTests.java b/spring-data-jdbc/src/test/java/org/springframework/data/jdbc/repository/JdbcRepositoryResultSetExtractorIntegrationTests.java index 3ac57d78f..82b6fe60f 100644 --- a/spring-data-jdbc/src/test/java/org/springframework/data/jdbc/repository/JdbcRepositoryResultSetExtractorIntegrationTests.java +++ b/spring-data-jdbc/src/test/java/org/springframework/data/jdbc/repository/JdbcRepositoryResultSetExtractorIntegrationTests.java @@ -88,19 +88,19 @@ public class JdbcRepositoryResultSetExtractorIntegrationTests { // NOT saving anything, so DB is empty - assertThat(personRepository.findAllPeopleWithAdresses()).isEmpty(); + assertThat(personRepository.findAllPeopleWithAddresses()).isEmpty(); } @Test // DATAJDBC-290 - public void findAllPeopleWithAdressesReturnsOnePersonWithoutAdresses() { + public void findAllPeopleWithAddressesReturnsOnePersonWithoutAddresses() { personRepository.save(new Person(null, "Joe", null)); - assertThat(personRepository.findAllPeopleWithAdresses()).hasSize(1); + assertThat(personRepository.findAllPeopleWithAddresses()).hasSize(1); } @Test // DATAJDBC-290 - public void findAllPeopleWithAdressesReturnsOnePersonWithAdresses() { + public void findAllPeopleWithAddressesReturnsOnePersonWithAddresses() { final String personName = "Joe"; Person savedPerson = personRepository.save(new Person(null, personName, null)); @@ -114,13 +114,13 @@ public class JdbcRepositoryResultSetExtractorIntegrationTests { MapSqlParameterSource paramsAddress2 = buildAddressParameters(savedPerson.getId(), street2); template.update("insert into address (street, person_id) values (:street, :personId)", paramsAddress2); - List people = personRepository.findAllPeopleWithAdresses(); + List people = personRepository.findAllPeopleWithAddresses(); assertThat(people).hasSize(1); Person person = people.get(0); assertThat(person.getName()).isEqualTo(personName); - assertThat(person.getAdresses()).hasSize(2); - assertThat(person.getAdresses()).extracting(a -> a.getStreet()).containsExactlyInAnyOrder(street1, street2); + assertThat(person.getAddresses()).hasSize(2); + assertThat(person.getAddresses()).extracting(a -> a.getStreet()).containsExactlyInAnyOrder(street1, street2); } private MapSqlParameterSource buildAddressParameters(Long id, String streetName) { @@ -137,7 +137,7 @@ public class JdbcRepositoryResultSetExtractorIntegrationTests { @Query( value = "select p.id, p.name, a.id addrId, a.street from person p left join address a on(p.id = a.person_id)", resultSetExtractorClass = PersonResultSetExtractor.class) - List findAllPeopleWithAdresses(); + List findAllPeopleWithAddresses(); } @Data @@ -146,7 +146,7 @@ public class JdbcRepositoryResultSetExtractorIntegrationTests { @Id private Long id; private String name; - private List
adresses; + private List
addresses; } @Data @@ -176,13 +176,13 @@ public class JdbcRepositoryResultSetExtractorIntegrationTests { } }); - if (currentPerson.getAdresses() == null) { - currentPerson.setAdresses(new ArrayList<>()); + if (currentPerson.getAddresses() == null) { + currentPerson.setAddresses(new ArrayList<>()); } long addrId = rs.getLong("addrId"); if (!rs.wasNull()) { - currentPerson.getAdresses().add(new Address(addrId, rs.getString("street"))); + currentPerson.getAddresses().add(new Address(addrId, rs.getString("street"))); } } diff --git a/spring-data-jdbc/src/test/java/org/springframework/data/jdbc/repository/query/QueryAnnotationHsqlIntegrationTests.java b/spring-data-jdbc/src/test/java/org/springframework/data/jdbc/repository/query/QueryAnnotationHsqlIntegrationTests.java index 4959865a0..4e7162eb8 100644 --- a/spring-data-jdbc/src/test/java/org/springframework/data/jdbc/repository/query/QueryAnnotationHsqlIntegrationTests.java +++ b/spring-data-jdbc/src/test/java/org/springframework/data/jdbc/repository/query/QueryAnnotationHsqlIntegrationTests.java @@ -172,7 +172,7 @@ public class QueryAnnotationHsqlIntegrationTests { } @Test // DATAJDBC-175 - public void executeCustomQueryWithReturnTypeIsNubmer() { + public void executeCustomQueryWithReturnTypeIsNumber() { repository.save(dummyEntity("aaa")); repository.save(dummyEntity("bbb")); @@ -200,7 +200,7 @@ public class QueryAnnotationHsqlIntegrationTests { public void executeCustomQueryWithReturnTypeIsDate() { // Since Timestamp extends Date the repository returns the Timestamp as it comes from the database. - // Trying to compare that to an actual Date results in non determistic results, so we have to use an actual + // Trying to compare that to an actual Date results in non deterministic results, so we have to use an actual // Timestamp. Date now = new Timestamp(System.currentTimeMillis()); assertThat(repository.nowWithDate()).isAfterOrEqualsTo(now); diff --git a/spring-data-jdbc/src/test/java/org/springframework/data/jdbc/repository/support/JdbcRepositoryFactoryBeanUnitTests.java b/spring-data-jdbc/src/test/java/org/springframework/data/jdbc/repository/support/JdbcRepositoryFactoryBeanUnitTests.java index f479ac152..bb1385f74 100644 --- a/spring-data-jdbc/src/test/java/org/springframework/data/jdbc/repository/support/JdbcRepositoryFactoryBeanUnitTests.java +++ b/spring-data-jdbc/src/test/java/org/springframework/data/jdbc/repository/support/JdbcRepositoryFactoryBeanUnitTests.java @@ -98,7 +98,7 @@ public class JdbcRepositoryFactoryBeanUnitTests { } @Test(expected = IllegalStateException.class) // DATAJDBC-155 - public void afterPropertiesThowsExceptionWhenNoMappingContextSet() { + public void afterPropertiesThrowsExceptionWhenNoMappingContextSet() { factoryBean.setMappingContext(null); factoryBean.setApplicationEventPublisher(publisher); diff --git a/src/main/asciidoc/jdbc.adoc b/src/main/asciidoc/jdbc.adoc index 5ec38146b..bba05f79d 100644 --- a/src/main/asciidoc/jdbc.adoc +++ b/src/main/asciidoc/jdbc.adoc @@ -309,7 +309,7 @@ public class EmbeddedEntity { String name; } ---- -<1> ``Null``s `embeddedEntity` if `name` in `null`. Use `USE_EMPTY` to instanciate `embeddedEntity` with a potential `null` value for the `name` property. +<1> ``Null``s `embeddedEntity` if `name` in `null`. Use `USE_EMPTY` to instantiate `embeddedEntity` with a potential `null` value for the `name` property. ==== If you need a value object multiple times in an entity, this can be achieved with the optional `prefix` element of the `@Embedded` annotation. @@ -317,7 +317,7 @@ This element represents a prefix and is prepend for each column name in the embe [TIP] ==== -Make use of the shortcuts `@Embedded.Nullable` & `@Embedded.Empty` for `@Embedded(onEmpty = USE_NULL)` and `@Embedded(onEmpty = USE_EMPTY)` to reduce verbositility and simultaneously set JSR-305 `@javax.annotation.Nonnull` accordingly. +Make use of the shortcuts `@Embedded.Nullable` & `@Embedded.Empty` for `@Embedded(onEmpty = USE_NULL)` and `@Embedded(onEmpty = USE_EMPTY)` to reduce verbosity and simultaneously set JSR-305 `@javax.annotation.Nonnull` accordingly. [source, java] ----