My entity class:
class User : ActiveRecord<User>() {
var name by Column(String.javaClass);
var id by Column(Int.javaClass);
}
now I want to set name value by refelection:
var clazz = User().javaClass
var record = clazz.newInstance()
var field = record.getDeclaredField(it + "$" + "delegate")
field.set(record, "aa")
then error:
entity.Column field ActiveRecord4k.User.name$delegate to java.lang.String
how to do this?
record.name = "aa"
? – Tinsel