Skip to content

Commit 42041a8

Browse files
committed
Align with v4.5.x branch
1 parent 985176c commit 42041a8

34 files changed

+70
-96
lines changed

pom.xml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -665,9 +665,7 @@
665665
<phase>site-deploy</phase>
666666
<configuration>
667667
<!-- Plugin configuration ges here -->
668-
669668
<server>github</server>
670-
671669
<!-- The commit message -->
672670
<message>Building site</message>
673671
<!-- The location where the site is uploaded -->
@@ -710,8 +708,8 @@
710708
<url>https://github.com/vitolimandibhrata</url>
711709
</contributor>
712710
<contributor>
713-
<name>Alex Arana</name>
714-
<url>https://github.com/alexarana</url>
711+
<name>Alex Arana</name>
712+
<url>https://github.com/alexarana</url>
715713
</contributor>
716714
<contributor>
717715
<name>Davin</name>

src/changes/changes.xml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
xsi:schemaLocation="http://maven.apache.org/changes/1.0.0 http://maven.apache.org/xsd/changes-1.0.0.xsd">
2121
<properties>
2222
<title>spring-data-dynamodb Changes</title>
23-
<author email="zeeman@zeeman.de" >derjust</author>
23+
<author email="zeeman@zeeman.de">derjust</author>
2424
</properties>
2525
<body>
2626
<release version="5.0.2" date="" description="Maintenance release">
@@ -45,32 +45,49 @@
4545
<action dev="derjust" issue="118" type="fix" date="2018-02-01">
4646
Handle hash key properties with different column name (attribute name) properly
4747
</action>
48+
<action dev="derjust" type="add" issue="136">
49+
Transfer to spring-data-dynamodb organization
50+
</action>
4851
</release>
4952
<release version="5.0.1" date="2018-01-06" description="Maintenance release">
50-
<action dev="derjust" issue="68" type="fix" date="2017-12-01" >
53+
<action dev="derjust" issue="68" type="fix" date="2017-12-01">
5154
Respecting DynamoDBOperations.batchSave()'s List&lt;FailedBatch&gt; return value and turn it into a BatchWriteException
5255
</action>
53-
<action dev="derjust" type="add" date="2017-12-01" >
56+
<action dev="derjust" type="add" date="2017-12-01">
5457
Added maven-changes-plugin to build process
5558
</action>
56-
<action dev="derjust" type="add" date="2017-12-17" >
59+
<action dev="derjust" type="add" date="2017-12-17">
5760
Update Mockito and resolve dependency clashes
5861
</action>
5962
<action dev="Gaurav Rawat" type="fix" issue="91">
6063
Fixed false assertion introduced implementing #91
6164
</action>
65+
<action dev="Alex Arana" type="add" issue="62">
66+
Support @DynamoDBTypeConverted instead of/in addition to @DynamoDBMarshalling for query methods
67+
</action>
6268
<action dev="derjust" type="fix" issue="109">
6369
Fix incorrect passing of an Optional into the delete method
6470
</action>
6571
<action dev="Alex Arana" type="add" issue="62">
6672
Support @DynamoDBTypeConverted instead of/in addition to @DynamoDBMarshalling for query methods
6773
</action>
74+
<action dev="derjust" type="add" issue="136">
75+
Transfer to spring-data-dynamodb organization
76+
</action>
6877
</release>
6978
<release version="5.0.0" date="2017-11-27" description="Spring 5 release" >
7079
<action dev="derjust" type="add">
7180
Added Spring 5 / Spring-Data Kay support
7281
</action>
7382
</release>
83+
<release version="4.5.5" date="" description="Backport of v5.0 (master)">
84+
<action dev="derjust" type="fix" issue="139">
85+
Backport of v5.0 branch (master)
86+
</action>
87+
<action dev="derjust" type="add" issue="136">
88+
Transfer to spring-data-dynamodb organization
89+
</action>
90+
</release>
7491
<release version="4.5.4" date="2017-01-23" description="Backport of PR #79">
7592
<action dev="Alex Arana" type="add" issue="62">
7693
Support @DynamoDBTypeConverted instead of/in addition to @DynamoDBMarshalling for query methods

src/main/java/org/socialsignin/spring/data/dynamodb/config/DynamoDBAuditingRegistrar.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
import org.slf4j.Logger;
1919
import org.slf4j.LoggerFactory;
20+
import org.socialsignin.spring.data.dynamodb.mapping.DynamoDBMappingContext;
21+
import org.socialsignin.spring.data.dynamodb.mapping.event.AuditingEventListener;
2022
import org.springframework.beans.factory.config.BeanDefinition;
2123
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
2224
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
@@ -26,14 +28,12 @@
2628
import org.springframework.data.auditing.config.AuditingBeanDefinitionRegistrarSupport;
2729
import org.springframework.data.auditing.config.AuditingConfiguration;
2830
import org.springframework.data.config.ParsingUtils;
29-
import org.socialsignin.spring.data.dynamodb.mapping.DynamoDBMappingContext;
30-
import org.socialsignin.spring.data.dynamodb.mapping.event.AuditingEventListener;
3131
import org.springframework.util.Assert;
3232

3333
import java.lang.annotation.Annotation;
3434

35-
import static org.springframework.beans.factory.config.BeanDefinition.ROLE_INFRASTRUCTURE;
3635
import static org.socialsignin.spring.data.dynamodb.config.BeanNames.MAPPING_CONTEXT_BEAN_NAME;
36+
import static org.springframework.beans.factory.config.BeanDefinition.ROLE_INFRASTRUCTURE;
3737

3838
/**
3939
* {@link org.springframework.context.annotation.ImportBeanDefinitionRegistrar} to enable {@link EnableDynamoDBAuditing} annotation.

src/main/java/org/socialsignin/spring/data/dynamodb/core/DynamoDBOperations.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929

3030
public interface DynamoDBOperations {
3131

32-
<T> int count(Class<T> domainClass,DynamoDBQueryExpression<T> queryExpression);
33-
<T> int count(Class<T> domainClass,DynamoDBScanExpression scanExpression);
32+
<T> int count(Class<T> domainClass, DynamoDBQueryExpression<T> queryExpression);
33+
<T> int count(Class<T> domainClass, DynamoDBScanExpression scanExpression);
3434
<T> int count(Class<T> clazz, QueryRequest mutableQueryRequest);
3535

3636

src/main/java/org/socialsignin/spring/data/dynamodb/core/DynamoDBTemplate.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ public void delete(Object entity) {
187187
@Override
188188
public List<FailedBatch> batchDelete(Iterable<?> entities) {
189189
entities.forEach(it -> maybeEmitEvent(it, BeforeDeleteEvent::new));
190-
190+
191191
List<FailedBatch> result = dynamoDBMapper.batchDelete(entities);
192192

193193
entities.forEach(it -> maybeEmitEvent(it, AfterDeleteEvent::new));

src/main/java/org/socialsignin/spring/data/dynamodb/mapping/DynamoDBMappingContext.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ protected <T> DynamoDBPersistentEntityImpl<?> createPersistentEntity(TypeInforma
5757
* org.springframework.data.mapping.MutablePersistentEntity,
5858
* org.springframework.data.mapping.SimpleTypeHolder)
5959
*/
60-
6160
@Override
6261
protected DynamoDBPersistentProperty createPersistentProperty(Property property,
63-
DynamoDBPersistentEntityImpl<?> owner, SimpleTypeHolder simpleTypeHolder) {
62+
DynamoDBPersistentEntityImpl<?> owner,
63+
SimpleTypeHolder simpleTypeHolder) {
6464
return new DynamoDBPersistentPropertyImpl(property, owner, simpleTypeHolder);
6565
}
6666

src/main/java/org/socialsignin/spring/data/dynamodb/repository/cdi/DynamoDBRepositoryBean.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
import com.amazonaws.services.dynamodbv2.AmazonDynamoDB;
1919
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapperConfig;
20-
2120
import org.socialsignin.spring.data.dynamodb.core.DynamoDBOperations;
2221
import org.socialsignin.spring.data.dynamodb.core.DynamoDBTemplate;
2322
import org.socialsignin.spring.data.dynamodb.repository.support.DynamoDBRepositoryFactory;

src/main/java/org/socialsignin/spring/data/dynamodb/repository/query/AbstractDynamoDBQuery.java

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public Object execute(AbstractDynamoDBQuery<T, ID> dynamoDBQuery, Object[] value
106106

107107
private List<T> restrictMaxResultsIfNecessary(Iterator<T> iterator) {
108108
int processed = 0;
109-
List<T> resultsPage = new ArrayList<T>();
109+
List<T> resultsPage = new ArrayList<>();
110110
while (iterator.hasNext() && processed < getResultsRestrictionIfApplicable()) {
111111
resultsPage.add(iterator.next());
112112
processed++;
@@ -129,8 +129,8 @@ public PagedExecution(Parameters<?, ?> parameters) {
129129
this.parameters = parameters;
130130
}
131131

132-
private int scanThroughResults(Iterator<T> iterator, long resultsToScan) {
133-
int processed = 0;
132+
private long scanThroughResults(Iterator<T> iterator, long resultsToScan) {
133+
long processed = 0;
134134
while (iterator.hasNext() && processed < resultsToScan) {
135135
iterator.next();
136136
processed++;
@@ -141,7 +141,7 @@ private int scanThroughResults(Iterator<T> iterator, long resultsToScan) {
141141
private List<T> readPageOfResultsRestrictMaxResultsIfNecessary(Iterator<T> iterator, int pageSize) {
142142
int processed = 0;
143143
int toProcess = getResultsRestrictionIfApplicable() != null ? Math.min(pageSize,getResultsRestrictionIfApplicable()) : pageSize;
144-
List<T> resultsPage = new ArrayList<T>();
144+
List<T> resultsPage = new ArrayList<>();
145145
while (iterator.hasNext() && processed < toProcess) {
146146
resultsPage.add(iterator.next());
147147
processed++;
@@ -165,7 +165,7 @@ private Page<T> createPage(List<T> allResults, Pageable pageable,AbstractDynamoD
165165

166166
Iterator<T> iterator = allResults.iterator();
167167
if (pageable.getOffset() > 0) {
168-
int processedCount = scanThroughResults(iterator, pageable.getOffset());
168+
long processedCount = scanThroughResults(iterator, pageable.getOffset());
169169
if (processedCount < pageable.getOffset())
170170
return new PageImpl<>(new ArrayList<T>());
171171
}
@@ -194,8 +194,8 @@ public SlicedExecution(Parameters<?, ?> parameters) {
194194
this.parameters = parameters;
195195
}
196196

197-
private int scanThroughResults(Iterator<T> iterator, long resultsToScan) {
198-
int processed = 0;
197+
private long scanThroughResults(Iterator<T> iterator, long resultsToScan) {
198+
long processed = 0;
199199
while (iterator.hasNext() && processed < resultsToScan) {
200200
iterator.next();
201201
processed++;
@@ -228,17 +228,16 @@ public Object execute(AbstractDynamoDBQuery<T, ID> dynamoDBQuery, Object[] value
228228
private Slice<T> createSlice(List<T> allResults, Pageable pageable) {
229229

230230
Iterator<T> iterator = allResults.iterator();
231-
int processedCount = 0;
232231
if (pageable.getOffset() > 0) {
233-
processedCount = scanThroughResults(iterator, pageable.getOffset());
232+
long processedCount = scanThroughResults(iterator, pageable.getOffset());
234233
if (processedCount < pageable.getOffset())
235-
return new SliceImpl<T>(new ArrayList<T>());
234+
return new SliceImpl<>(new ArrayList<T>());
236235
}
237236
List<T> results = readPageOfResultsRestrictMaxResultsIfNecessary(iterator, pageable.getPageSize());
238237
// Scan ahead to retrieve the next page count
239238
boolean hasMoreResults = scanThroughResults(iterator, 1) > 0;
240-
if (getResultsRestrictionIfApplicable() != null && getResultsRestrictionIfApplicable().intValue() <= results.size()) hasMoreResults = false;
241-
return new SliceImpl<T>(results, pageable, hasMoreResults);
239+
if (getResultsRestrictionIfApplicable() != null && getResultsRestrictionIfApplicable().intValue() <= results.size()) hasMoreResults = false;
240+
return new SliceImpl<>(results, pageable, hasMoreResults);
242241
}
243242
}
244243

src/main/java/org/socialsignin/spring/data/dynamodb/repository/query/AbstractDynamoDBQueryCriteria.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,6 @@ protected <V extends Object> Object getPropertyAttributeValue(final String prope
487487
} else if (tableModel != null) { // purely here for testing as DynamoDBMapperTableModel cannot be mocked using Mockito
488488

489489
String attributeName = getAttributeName(propertyName);
490-
entityInformation.getOverriddenAttributeName(propertyName).orElse(propertyName);
491490

492491
DynamoDBMapperFieldModel<T,Object> fieldModel = tableModel.field(attributeName);
493492
if (fieldModel != null) {

src/main/java/org/socialsignin/spring/data/dynamodb/repository/query/DynamoDBEntityWithHashAndRangeKeyCriteria.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public DynamoDBQueryExpression<T> buildQueryExpression() {
145145
if (isHashKeySpecified()) {
146146
T hashKeyPrototype = entityInformation.getHashKeyPropotypeEntityForHashKey(getHashKeyPropertyValue());
147147
queryExpression.withHashKeyValues(hashKeyPrototype);
148-
queryExpression.withRangeKeyConditions(new HashMap<>());
148+
queryExpression.withRangeKeyConditions(new HashMap<String, Condition>());
149149
}
150150

151151
if (isRangeKeySpecified() && !isApplicableForGlobalSecondaryIndex()) {

0 commit comments

Comments
 (0)