

As traduções são geradas por tradução automática. Em caso de conflito entre o conteúdo da tradução e da versão original em inglês, a versão em inglês prevalecerá.

# Diferenças de setters fluentes entre a versão 1 e a versão 2 do SDK para Java
<a name="dynamodb-migrate-fluent-setters"></a>

Você pode usar POJOs com configuradores fluentes na API de mapeamento do DynamoDB para V1 e com V2 desde a versão 2.30.29. 

Por exemplo, o POJO a seguir retorna uma instância `Customer` do método `setName`:

```
// V1

@DynamoDBTable(tableName ="Customer")
public class Customer{
  private String name;
  // Other attributes and methods not shown.
  public Customer setName(String name){
     this.name = name;
     return this;
  }
}
```

No entanto, se você usar uma versão da V2 anterior à 2.30.29, `setName` retornará uma instância `Customer` com um valor `name` de `null`.

```
// V2 prior to version 2.30.29.

@DynamoDbBean
public class Customer{
  private String name;
  // Other attributes and methods not shown.
  public Customer setName(String name){ 
     this.name = name;
     return this;  // Bug: returns this instance with a `name` value of `null`.
  }
}
```

```
// Available in V2 since version 2.30.29.

@DynamoDbBean
public class Customer{
  private String name;
  // Other attributes and methods not shown.
  public Customer setName(String name){ 
     this.name = name;
     return this;  // Returns this instance for method chaining with the `name` value set.
  }
}
```