-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,56 @@ | ||
# dynamodb-spring-boot | ||
|
||
[![Coverage Status](https://coveralls.io/repos/github/wonwoo/dynamodb-spring-boot/badge.svg?branch=master)](https://coveralls.io/github/wonwoo/dynamodb-spring-boot?branch=master) [![Build Status](https://travis-ci.org/wonwoo/dynamodb-spring-boot.svg?branch=master)](https://travis-ci.org/wonwoo/dynamodb-spring-boot) | ||
|
||
|
||
### dynamodb-spring-boot Example | ||
|
||
1. application.properties | ||
``` | ||
spring.data.dynamodb.access-key=<your access-key> | ||
spring.data.dynamodb.secret-key=<your secret-key> | ||
``` | ||
|
||
2. PersonRepository | ||
```java | ||
@EnableScan | ||
public interface PersonRepository extends DynamoDBRepository<Person, String> { | ||
} | ||
``` | ||
|
||
3. Person | ||
|
||
```java | ||
@DynamoDBTable(tableName = "persons") | ||
public class Person { | ||
|
||
@DynamoDBHashKey | ||
@DynamoDBAutoGeneratedKey | ||
private String id; | ||
private String name; | ||
|
||
public Person() { | ||
|
||
} | ||
// getter setter etc | ||
} | ||
``` | ||
|
||
4. Sample | ||
```java | ||
@Bean | ||
CommandLineRunner commandLineRunner(PersonRepository personRepository) { | ||
return args -> { | ||
personRepository.save(Arrays.asList( | ||
new Person("kevin"), | ||
new Person("josh long")) | ||
); | ||
personRepository.findAll() | ||
.forEach(System.out::println); | ||
}; | ||
} | ||
``` | ||
|
||
### dynamodb-spring-boot-test Example | ||
|
||
TODO |