storio: Auto generated GetResolver has constructor with wrong parameter order in Kotlin

Reproduction steps:

  1. create class with more than two columns f.e.
@StorIOSQLiteType(table = "CreditCard")
data class CreditCard @StorIOSQLiteCreator constructor(
        @get:StorIOSQLiteColumn(name = "id", key = true) val cardId: Long,
        @get:StorIOSQLiteColumn(name = "name") val name: String,
        @get:StorIOSQLiteColumn(name = "expireYear") val expireYear: Int,
        @get:StorIOSQLiteColumn(name = "expireMonth") val expireMonth: Int,
        @get:StorIOSQLiteColumn(name = "type") val type: String,
        @get:StorIOSQLiteColumn(name = "isDefault") val isDefault: Boolean)
  1. build project (couple of times if needed).

The reason for that is kapt (kotlins annotation processor, don’t know about apt) does not process annotations in creation order.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 18 (3 by maintainers)

Commits related to this issue

Most upvoted comments

I just checked that @pbochenski is actually right and you can get actual parameters names from getParameters() on ExecutableElement. So it should be possible to map columns with parameters relying just on their names.