0

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

@DynamoDbBeandata 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?

askedyesterday
Salil Surendran's user avatar

0

Know someone who can answer? Share a link to thisquestion viaemail,Twitter, orFacebook.

Your Answer

Sign up orlog in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

By clicking “Post Your Answer”, you agree to ourterms of service and acknowledge you have read ourprivacy 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.