Skip to content

DynamoDB Enhanced Client: @DynamoDbIgnore fails in some property mapping scenarios #7328

Description

@hiroki-otaka

Describe the bug

The DynamoDB Enhanced Client fails to recognize a valid setter when a bean has both getA() and isA() methods, even when isA() is annotated with @DynamoDbIgnore.

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

a should be mapped using:

getA(): int
setA(int): void

and isA() should be ignored because of @DynamoDbIgnore.

Current Behavior

The setA(int) setter is not recognized, and the a attribute is not mapped correctly.

This appears to be caused by the interaction between JavaBeans property introspection and the two getters:

getA(): int
isA(): boolean

Even though isA() is annotated with @DynamoDbIgnore, it still affects property discovery.

Reproduction Steps

@DynamoDbBean
public class Foo {
    private int a;

    @DynamoDbAttribute("A")
    public int getA() {
        return a;
    }

    public void setA(int a) {
        this.a = a;
    }

    @DynamoDbIgnore
    public boolean isA() {
        return false;
    }
}

Possible Solution

No response

Additional Information/Context

The same class is mapped correctly by the AWS SDK for Java v1, which does not rely on the same JavaBeans property conventions as the v2 Enhanced Client.

AWS Java SDK version used

2.51.3

JDK version used

11.0.32.1

Operating System and version

Windows 11

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.dynamodb-enhancedneeds-reviewThis issue or PR needs review from the team.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions