Created
August 18, 2020 18:51
-
-
Save yairzaslavsky/8cc4e87ff83425b492522d2bcdb70f04 to your computer and use it in GitHub Desktop.
Person2.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* DDB Enhanced client mapper annotations can be applied only to methods. | |
* This is why we cannot use a data class here. | |
*/ | |
@DynamoDbBean | |
class Person(personId: String, name: String, familyName: String) { | |
@get:DynamoDbPartitionKey | |
var personId = personId; | |
@get:DynamoDbSecondaryPartitionKey(indexNames = ["familyName-index"]) | |
var familyName: String = "", | |
@get:DynamoDbAttribute(value = "createTime") | |
var createTime: Long = java.time.Instant.now().epochSecond | |
@get:DynamoDbAttribute(value = "updateTime") | |
var updateTime: Long = java.time.Instant.now().epochSecond | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment