Return last log entered with greenDAO

0

I am working an android App with greenDAO, I need to keep an order-detail but I can not find a practical way to do it, I do not know if there is a method that returns the created object. at the moment what I happen to do is enter the record and then make a query of its id (it is a self-reinforcing in the base) and that set it to detail.

orden.setCantidad(cantidad)
ordenDao.insert(orden)
int ultimoReg = ultimoReg(); // este me retorna el ultimo id en la base
detalle.setOrdenId(ultimoReg)
    
asked by Igmer Rodriguez 21.10.2018 в 05:57
source

0 answers