[JAVA] spring data dynamodb trap

Synopsis

I found it when I was using the library spring-data-dynamodb to access DynamoDB of ʻAWS from spring boot`, so I decided to write it.

Contents

The beginning of the matter is to create the table and attributes defined in the snake case in DynamoDB, and define thefindByitemAttr ()method to access it from spring. And when I try to execute it, the following error message appears and it cannot be started.

error contents


You have defined query method in the repository but you don't have any query lookup strategy defined.
The infrastructure apparently does not support query methods!

Translated into Japanese, he said something like "I defined a query method in the repository, but it doesn't support queries because the query search method is not defined." When I was worried about it, I got a warning when I started it. I remember. I thought it was probably because of the version compatibility mismatch between spring boot and spring data dynamod b.

There must be such a reason. When I started by matching the versions while thinking, it started brilliantly, and I was able to access the table that defines the snake case.

By the way, the version when the error occurred is as follows. ・ Spring Boot: 2.1.3 ・ Spring data dynamodb: 5.0.4

From there I modified the version of Spring Boot to 2.0.8.

At the end

This time, my bad points came out. Everyone should be careful about version compatibility.

By the way, the story of version compatibility of sprinf-data-dynamodb is written below. https://derjust.github.io/spring-data-dynamodb/

Even so, spring data dynamodb, if it is version compatible and an error occurs, please give an error that is a little easier to understand.

Recommended Posts

spring data dynamodb trap
Spring Data JDBC Preview
[spring] Let's use Spring Data JPA
How to use Spring Data JDBC
[How to install Spring Data Jpa]
Spring Data JPA SQL log output
OR search with Spring Data Jpa Specification
Spring with Kotorin --2 RestController and Data Class
Exists using Specification in Spring Data JPA
[IOS] How to get data from DynamoDB
Use DynamoDB query method in Spring Boot
Null support cache in Spring Data Redis
To write Response data directly in Spring
I tried Spring Data JDBC 1.0.0.BUILD-SNAPSHOT (-> 1.0.0.RELEASE)