Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get the latest updated row saved with Ebean in Play Framework

I am learning the Play Framework. I have created some Form and saved the corresponding object into my database with:

object.save();

I want to get the object that is just saved. I checked the documentation and found out that save() doesn't have a return type.

So is there anyway I can get that object? (The id column of the object table is set to auto-increment, if that may help)

like image 861
Tony Avatar asked Dec 10 '25 10:12

Tony


1 Answers

You hava that object yet! check:

...
object.save();
debug("ID of the new object is: " + object.id);
like image 73
biesior Avatar answered Dec 12 '25 06:12

biesior