Skip to content

Add support for @AccessType(AccessType.Type.FIELD) #564

Open
@ksklodowski-transactionlink

Description

Expected Behavior

I would like to remove setters and getters from entity class and replace them with annotation:
@AccessType(AccessType.Type.FIELD)

Actual Behavior

com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMappingException: Example; no mapping for HASH key

Steps to Reproduce the Problem

  1. Create class with annotations
@DynamoDBTable(tableName = "ExampleTable")
@NoArgsConstructor(access = PRIVATE)
@AllArgsConstructor(access = PRIVATE)
@AccessType(FIELD)
public class Example {

    @DynamoDBHashKey
    private UUID id;
    private UUID taskId;
  
 }
  1. Try to save entity through the repository
@Repository
interface DynamoDbExampleRepository extends CrudRepository<Example, UUID> {

    Optional<Example> findByTaskId(final UUID taskId);

}

Specifications

  • Spring Data DynamoDB Version: 5.2.5
  • Spring Data Version: 2.4.0
  • AWS SDK Version: 1.11.951

All those information are logged by org.socialsignin.spring.data.dynamodb.repository.support.DynamoDBRepositoryFactory on INFO level on startup.
Or use java -version and mvn dependency:tree | grep -E 'spring|aws' to provide those version numbers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions