Sem título
# announcements
r
Sem título
r
what is the question
r
I would like to know why if I place the object inside a function, and when calling the insert method, I cannot assign it [name] = entity.name
r
ur using dsl
use dao
Person.new { name = “foo” }
r
It's not possible with DSL?
r
Copy code
val id = StarWarsFilms.insertAndGetId {
  it[name] = "The Last Jedi"
  it[sequelId] = 8
  it[director] = "Rian Johnson"
}
just more verbose
r
I don't think that's the answer. The problem is that I am not able to assign values, if the "object" is inside a function.
r
PersonTable.insert { it[PersonTable.name] = “foo” }
try that
your import is prob messed up
r
Copy code
PersonTable.insert {
it[PersonTable.name] = "foo"
}
I use it that way. Just see on lines 8 and 9. And worked. The problem is that the name of the table and the schema needs to be passed via parameter. So I changed it, lines 14 down.