michaellavelle / spring-data-dynamodb

Simplifies the development of creating an Amazon DynamoDB-based Java data access layer
https://derjust.github.io/spring-data-dynamodb/
Apache License 2.0
169 stars 284 forks source link

Updated User.java example #69

Closed ascooper57 closed 4 years ago

ascooper57 commented 8 years ago

package org.socialsignin.springframework.data.dynamodb.demo.domain;

import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBAttribute; import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBAutoGeneratedKey; import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBHashKey; import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBTable; import org.springframework.data.annotation.Id;

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

@Id
private String idHashKey;
private String firstName;
private String lastName;

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

public User() {}

@DynamoDBHashKey(attributeName = "IdHashKey")
@DynamoDBAutoGeneratedKey
public String getIdHashKey()
{
    return idHashKey;
}

public void setIdHashKey(String idHashKey) {
    this.idHashKey = idHashKey;
}

@DynamoDBAttribute(attributeName = "FirstName")
public String getFirstName()
{
    return firstName;
}

public void setFirstName(String firstName) {
    this.firstName = firstName;
}

@DynamoDBAttribute(attributeName = "LastName")
public String getLastName()
{
    return lastName;
}

public void setLastName(String lastName) {
    this.lastName = lastName;
}

}

derjust commented 8 years ago

What exactly does this new unit test code helps for? Please use derjust#20 for followup comments.

As (privately) communicated with @michaellavelle, the project will continue under https://github.com/derjust/spring-data-dynamodb.