I'm use the version 0.10.2 Yes, company is an UUID...
# exposed
d
I'm use the version 0.10.2 Yes, company is an UUIDEntity
t
How you create/get your
company
instance?
d
Currently I use "company = Company.all().first()", because it is not possible to create more than one company
and my definition is "lateinit var company: Company"
t
You mean that such code will fail?
Copy code
connect()
transaction {
   val company = Company.all().first()
   company.name = "Foo"
}
transaction {
   val company = Company.all().first()
   assertEquals("Foo", company.name)
}
d
yes
I think the problem is, that my code works like
Copy code
lateinit var company = Company()
connect()
transaction {
   company = Company.all().first()
}
transaction {
   company.name = "Foo"
}
transaction {
   val company = Company.all().first()
   assertEquals("Foo", company.name)
}
t
You should not construct Company like this :
Company()
. Replace it with
Company.new {}
BTW, I don't see why your code should not work...
d
Thank you for your answers. I think it is not possible to select an object in one function and change this in another function. Now I save the ID and select the data in both functions and it works.
t
d
This might be possible, but I did select the data in my init method and change the data within a listener