Mitja Debeljak
04/04/2024, 11:41 AMobject ProductTable : IntIdTable() {
val name = varchar("name", 80)
val price = double("price")
}
class ProductEntity(id: EntityID<Int>) : IntEntity(id) {
companion object : IntEntityClass<ProductEntity>(ProductTable)
var name by ProductTable.name
var price by ProductTable.price
}
...
class ProductQuery : Query {
private val repository = ProductRepository()
suspend fun products(): List<Product> = repository.findAll()
}
...
class ProductRepository {
suspend fun findAll(): List<Product> = query {
val products = ProductEntity.all().map { entityToProduct(it) }
products
}
}
When I build a native image and run it against a query that is calling this oblect, I get this error:
kotlin.reflect.jvm.internal.KotlinReflectionInternalError: Could not compute caller for function: public constructor ProductEntity(id: org.jetbrains.exposed.dao.id.EntityID<<http://kotlin.Int|kotlin.Int>>) defined in si.schlamberger.climbholds.db.product.ProductEntity[DeserializedClassConstructorDescriptor@733818e6] (member = null)
Dariusz Kuc
04/04/2024, 5:07 PMMitja Debeljak
04/05/2024, 9:59 AMDariusz Kuc
04/05/2024, 2:03 PMDariusz Kuc
04/05/2024, 2:03 PMMitja Debeljak
04/05/2024, 3:50 PM