0

I have the following class that I am using as a dynamodb item in Kotlin

@DynamoDbBean
data class Transaction(
    @get:DynamoDbPartitionKey
    val userId: Int,
    @get:DynamoDbSortKey
    val timestamp: Long,
    val ticker: String,
    val transactionType: Type)

val transactionTable =
    DynamoDBenhancedClient.table(MoneyBeacon.TRANSACTION_TABLE,
    TableSchema.fromBean(Transaction::class.java))

I get this error:

 java.lang.IllegalArgumentException: Class 'class db.aws.dynamodb.pojos.Transaction' appears to have no default constructor thus cannot be used with the BeanTableSchema

If I set this class up with a default constructor then I will have change it to var and allow the values to be nullable which I don't want to do. Any other solutions?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.