I know that I can save my objects in two different ways. But what is the diference between these lines?
Ebean.save(network);
network.save();
There is no difference.
The Play framework provides the save()
method, and others, by default on all model
types that are mapped as persisted entities.
The method does the same thing as Ebean.save()
but gives the benefit of abstracting away the details of the vendor specific ORM being used. If you are using Play framework, it is a best practice to call the save()
method directly on your model/entity than to call methods on EBean
directly.