@Retention(value=RUNTIME) @Target(value={TYPE,FIELD,METHOD}) public @interface DynamoDBTypeConvertedTimestamp
@DynamoDBTable(tableName="TestTable")
public class TestClass {
private String key;
private Date createdDate;
@DynamoDBHashKey
public String getKey() { return key; }
public void setKey(String key) { this.key = key; }
@DynamoDBTypeConvertedTimestamp(pattern="yyyyMMddHHmmssSSS", timeZone="UTC")
public Date getCreatedDate() { return createdDate; }
public void setCreatedDate(Date createdDate) { this.createdDate = createdDate; }
}
Please note,
Only Calendar, Date and Long are
supported for now. Primitives such as long are not supported since
the unset (or null) state can't be detected.
This annotation is also compatible with DynamoDBAutoGeneratedTimestamp.public abstract String pattern
SimpleDateFormatCopyright © 2016. All rights reserved.