https://kotlinlang.org logo
#exposed
Title
# exposed
s

SrSouza

03/06/2019, 4:52 PM
Hi guys, I want to know something about Exposed DAO How I can update the object after change him
Copy code
daoObj.name = "new Name"
transaction(database) {
   daoObj.update()
}
Something like this have?
s

SrSouza

03/06/2019, 8:20 PM
Okay, but let me try to explain how is suppose to work my code. I need to change the value SYNC, in the Main thread, but the update doesn't need to be, can be ASYNC. The DAO have a method to Flush the data?
t

tapac

03/06/2019, 9:00 PM
The you have to put entity back to cache and then it will be stored or just call
flush
Copy code
daoObj.name = "new Name"
transaction(database) {
   entityCache.store(daoObj) // will be persisted at the end of `transaction` block
  daoObj.flush() // will be persisted immidiatly 

}
s

SrSouza

03/06/2019, 9:06 PM
Tkx so much @tapac
👌 1