Skip to content

Commit 9f4ba4a

Browse files
committed
Merge pull request #209 from derjust/enriquezrene-Issue-199
Enriquezrene issue 199
2 parents 541c1bf + 151a592 commit 9f4ba4a

File tree

3 files changed

+12
-27
lines changed

3 files changed

+12
-27
lines changed

README.md

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ Create a CRUD repository interface [UserRepository](https://github.com/derjust/s
8888
@EnableScan
8989
public interface UserRepository extends CrudRepository<User, String> {
9090
List<User> findByLastName(String lastName);
91+
List<User> findByFirstName(String firstName);
9192
}
9293
```
9394

@@ -96,6 +97,7 @@ or for paging and sorting...
9697
```java
9798
public interface PagingUserRepository extends PagingAndSortingRepository<User, String> {
9899
Page<User> findByLastName(String lastName, Pageable pageable);
100+
Page<User> findByFirstName(String firstName, Pageable pageable);
99101

100102
@EnableScan
101103
@EnableScanCount
@@ -142,34 +144,8 @@ public static class DynamoDBConfig {
142144
}
143145
```
144146

145-
And finally write a test client [UserRepositoryIT](https://github.com/derjust/spring-data-dynamodb-examples/blob/master/src/test/java/com/github/derjust/spring_data_dynamodb_examples/simple/UserRepositoryIT.java):
147+
And finally write a test client [UserRepositoryIT](https://github.com/derjust/spring-data-dynamodb-examples/blob/master/src/test/java/com/github/derjust/spring_data_dynamodb_examples/simple/UserRepositoryIT.java) or start calling it from your existing Spring code.
146148

147-
```java
148-
@RunWith(SpringRunner.class)
149-
@SpringBootTest(classes = { PropertyPlaceholderAutoConfiguration.class, DynamoDBConfig.class })
150-
public class UserRepositoryIT {
151-
private static final Logger log = LoggerFactory.getLogger(UserRepositoryIT.class);
152-
153-
@Autowired
154-
private UserRepository repository;
155-
156-
@Test
157-
public void sampleTestCase() {
158-
User gosling = new User("James", "Gosling");
159-
repository.save(gosling);
160-
161-
User hoeller = new User("Juergen", "Hoeller");
162-
repository.save(hoeller);
163-
164-
List<User> result = repository.findByLastName("Gosling");
165-
Assert.assertThat(result.size(), is(1));
166-
Assert.assertThat(result, hasItem(gosling));
167-
log.info("Found in table: {}", result.get(0));
168-
}
169-
170-
// setup code
171-
}
172-
```
173149

174150
The full source code is available at [spring-data-dynamodb-examples' simple example](https://github.com/derjust/spring-data-dynamodb-examples/blob/master/README-simple.md)
175151

pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -790,6 +790,10 @@
790790
<name>Alex Simkin</name>
791791
<url>https://github.com/SimY4</url>
792792
</contributor>
793+
<contributor>
794+
<name>Rene Enriquez</name>
795+
<url>enriquezrene</url>
796+
</contributor>
793797
</contributors>
794798

795799

src/changes/changes.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323
<author email="[email protected]">derjust</author>
2424
</properties>
2525
<body>
26+
<release version="5.0.4" date="" description="Maintenance &amp; security release">
27+
<action dev="enriquezrene" issue="199" type="fix" date="2018-10-11">
28+
Fix README.md examples
29+
</action>
30+
</release>
2631
<release version="5.0.3" date="2018-08-10" description="Maintenance &amp; security release">
2732
<action dev="derjust" type="fix" date="2018-03-05">
2833
Fix Javadoc and cast warnings

0 commit comments

Comments
 (0)