com.github.elvisnovoa:dynamodb-spring-boot-parent

Spring Boot starter project for spring-data-dynamodb

Лицензия

Лицензия

Категории

Категории

Spring Boot Контейнер Микросервисы
Группа

Группа

com.github.elvisnovoa
Идентификатор

Идентификатор

dynamodb-spring-boot-parent
Последняя версия

Последняя версия

1.0.0
Дата

Дата

Тип

Тип

pom
Описание

Описание

com.github.elvisnovoa:dynamodb-spring-boot-parent
Spring Boot starter project for spring-data-dynamodb
Ссылка на сайт

Ссылка на сайт

https://github.com/elvisnovoa/dynamodb-spring-boot
Система контроля версий

Система контроля версий

http://github.com/elvisnovoa/dynamodb-spring-boot/tree/main

Скачать dynamodb-spring-boot-parent

Имя Файла Размер
dynamodb-spring-boot-parent-1.0.0.pom 4 KB
Обзор

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.github.elvisnovoa/dynamodb-spring-boot-parent/ -->
<dependency>
    <groupId>com.github.elvisnovoa</groupId>
    <artifactId>dynamodb-spring-boot-parent</artifactId>
    <version>1.0.0</version>
    <type>pom</type>
</dependency>
// https://jarcasting.com/artifacts/com.github.elvisnovoa/dynamodb-spring-boot-parent/
implementation 'com.github.elvisnovoa:dynamodb-spring-boot-parent:1.0.0'
// https://jarcasting.com/artifacts/com.github.elvisnovoa/dynamodb-spring-boot-parent/
implementation ("com.github.elvisnovoa:dynamodb-spring-boot-parent:1.0.0")
'com.github.elvisnovoa:dynamodb-spring-boot-parent:pom:1.0.0'
<dependency org="com.github.elvisnovoa" name="dynamodb-spring-boot-parent" rev="1.0.0">
  <artifact name="dynamodb-spring-boot-parent" type="pom" />
</dependency>
@Grapes(
@Grab(group='com.github.elvisnovoa', module='dynamodb-spring-boot-parent', version='1.0.0')
)
libraryDependencies += "com.github.elvisnovoa" % "dynamodb-spring-boot-parent" % "1.0.0"
[com.github.elvisnovoa/dynamodb-spring-boot-parent "1.0.0"]

Зависимости

compile (1)

Идентификатор библиотеки Тип Версия
org.springframework.boot : spring-boot-starter jar 2.4.1

test (1)

Идентификатор библиотеки Тип Версия
org.springframework.boot : spring-boot-starter-test jar 2.4.1

Модули Проекта

  • dynamodb-spring-boot-autoconfigure
  • dynamodb-spring-boot-starter
  • dynamodb-spring-boot-sample-app

dynamodb-spring-boot

A simple wrapper for derjust's Spring Data DynamoDB.

Usage:

Add the dependency to your pom.xml

        <dependency>
            <groupId>com.github.elvisnovoa</groupId>
            <artifactId>dynamodb-spring-boot-starter</artifactId>
            <version>1.0.0</version>
        </dependency>

Then follow derjust's instructions to set up your repositories. For example, given a DynamoDB table named User, we have the corresponding POJO:

@DynamoDBTable(tableName = "User")
public class User {

    private String id;
    private String firstName;
    private String lastName;

    public User() {}

    public User(String firstName, String lastName) {
        this.firstName = firstName;
        this.lastName = lastName;
    }

    @DynamoDBHashKey
    @DynamoDBAutoGeneratedKey
    public String getId() {
        return id;
    }

    @DynamoDBAttribute
    public String getFirstName() {
        return firstName;
    }

    @DynamoDBAttribute
    public String getLastName() {
        return lastName;
    }
    
    // setters omitted
}

...and the following Spring Data Repository.

public interface UserRepository extends CrudRepository<User, String> {
    List<User> findByLastName(String lastName);
    List<User> findByFirstName(String firstName);
}

Customizing

This autoconfigure project uses the default spring-data-dynamodb configurations and reads any repositories in the same package of a @SpringBootApplication. To use different configurations, you can create your own configuration class and annotate it with @EnableDynamoDBRepositories. In that case, why are you using this?

The library also creates a com.amazonaws.services.dynamodbv2.AmazonDynamoDB bean with default configurations, but you can provide your own. For example:

    private AWSCredentialsProvider amazonAWSCredentialsProvider() {
        return new AWSStaticCredentialsProvider(amazonAWSCredentials());
    }

    private AWSCredentials amazonAWSCredentials() {
        return new BasicAWSCredentials("amazonAWSAccessKey", "amazonAWSSecretKey"); // Don't ever do this, plz
    }

    @Bean
    public AmazonDynamoDB amazonDynamoDB() {
        return AmazonDynamoDBClientBuilder.standard()
                .withCredentials(amazonAWSCredentialsProvider())
                .build();
    }

Версии библиотеки

Версия
1.0.0