storio: Auto generated GetResolver has constructor with wrong parameter order in Kotlin
Reproduction steps:
- 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)
- 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)
I just checked that @pbochenski is actually right and you can get actual parameters names from
getParameters()onExecutableElement. So it should be possible to map columns with parameters relying just on their names.