Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spring Boot 2.2 / Moore support #270

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Expand Up @@ -169,7 +169,10 @@ API changes will follow SEMVER and loosly the Spring Framework releases.
| 4.4.x | >= 1.4.0 && < 2.0 | >= 4.3 && < 5.0 | Hopper-SR2 |
| 4.5.x | >= 1.4.0 && < 2.0 | >= 4.3 && < 5.0 | Ingalls |
| 5.0.x | >= 2.0 && < 2.1 | >= 5.0 && < 5.1 | Kay-SR1 |
| 5.1.x | >= 2.1 | >= 5.1 | Lovelace-SR1 |
| 5.1.x | == 2.1 | >= 5.1 | Lovelace-SR1 |
| 5.2.x | >= 2.2 | >= 5.2 | Moore-RELASE |


`spring-data-dynamodb` depends directly on `spring-data` as also `spring-context`, `spring-data` and `spring-tx`.

`compile` and `runtime` dependencies are kept to a minimum to allow easy integartion, for example into
Expand Down
20 changes: 11 additions & 9 deletions pom.xml
Expand Up @@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.derjust</groupId>
<artifactId>spring-data-dynamodb</artifactId>
<version>5.1.1-SNAPSHOT</version>
<version>5.2.0-SNAPSHOT</version>
<name>Spring Data DynamoDB</name>
<inceptionYear>2018</inceptionYear>

Expand All @@ -37,11 +37,11 @@
</licenses>

<properties>
<spring.version>5.1.2.RELEASE</spring.version>
<spring-data.version>2.1.2.RELEASE</spring-data.version>
<spring.version>5.2.0.RELEASE</spring.version>
<spring-data.version>2.2.0.RELEASE</spring-data.version>

<hibernate-validator.version>6.0.9.Final</hibernate-validator.version>
<aws-java-sdk.version>1.11.515</aws-java-sdk.version>
<aws-java-sdk.version>1.11.664</aws-java-sdk.version>
<junit.version>4.12</junit.version>
<mockito.version>2.23.0</mockito.version>
<cdi.version>1.2</cdi.version>
Expand Down Expand Up @@ -252,7 +252,7 @@
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20.1</version>
<version>2.22.2</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
Expand Down Expand Up @@ -304,7 +304,7 @@
</manifest>
<manifestEntries>
<Specification-Title>Spring Data</Specification-Title>
<Specification-Version>2.1</Specification-Version>
<Specification-Version>2.2</Specification-Version>
</manifestEntries>
</archive>
</configuration>
Expand Down Expand Up @@ -362,7 +362,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.9</version>
<version>0.8.5</version>
<executions>
<execution>
<goals>
Expand Down Expand Up @@ -438,7 +438,7 @@
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>3.1.5</version>
<version>3.1.12.2</version>
<configuration>
<effort>Max</effort>
<!-- Reports all bugs (other values are medium and max) -->
Expand Down Expand Up @@ -851,6 +851,8 @@
<threshold>Low</threshold>
</configuration>
</plugin>


<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
Expand All @@ -873,7 +875,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>2.20.1</version>
<version>2.22.2</version>
<configuration>
</configuration>
</plugin>
Expand Down
Expand Up @@ -18,7 +18,6 @@
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMarshaller;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBTypeConverter;
import org.springframework.data.annotation.Id;
import org.springframework.data.repository.core.support.ReflectionEntityInformation;

import java.util.Map;
import java.util.Optional;
Expand All @@ -34,7 +33,9 @@
* @author Michael Lavelle
* @author Sebastian Just
*/
public class DynamoDBIdIsHashAndRangeKeyEntityInformationImpl<T, ID> extends ReflectionEntityInformation<T, ID>
public class DynamoDBIdIsHashAndRangeKeyEntityInformationImpl<T, ID>
extends
FieldAndGetterReflectionEntityInformation<T, ID>
implements
DynamoDBIdIsHashAndRangeKeyEntityInformation<T, ID> {

Expand Down
Expand Up @@ -77,6 +77,9 @@ public FieldAndGetterReflectionEntityInformation(@NonNull Class<T> domainClass,
if (method != null) {
ReflectionUtils.makeAccessible(method);
}
if (field != null) {
ReflectionUtils.makeAccessible(field);
}
}

/*
Expand All @@ -88,6 +91,7 @@ public FieldAndGetterReflectionEntityInformation(@NonNull Class<T> domainClass,
@Override
@SuppressWarnings("unchecked")
public ID getId(T entity) {

if (method != null) {
return entity == null ? null : (ID) ReflectionUtils.invokeMethod(method, entity);
} else {
Expand Down
Expand Up @@ -44,7 +44,7 @@ public static class TestAppConfig {

@Test
public void feed_test() {
PageRequest pageRequest = PageRequest.of(1, 10, new Sort(Direction.DESC, "usrNo"));
PageRequest pageRequest = PageRequest.of(1, 10, Sort.by(Direction.DESC, "usrNo"));
feedUserRepository.findByUsrNo(2, pageRequest); // runnable
feedUserRepository.findByUsrNoAndFeedOpenYn(2, true, pageRequest); // not runnable
}
Expand Down