Update the Task model - RuntimeException: DataSource user is null?

时光怂恿深爱的人放手 提交于 2019-12-06 11:18:46

Your update(Long id, Task task) method on Task model should be like below:

public static void update(Long id, Task task) {
    task.update(id); // updates this entity, by specifying the entity ID
}

Because you passed task variable as updated data, you don't need to find reference of Task object like you do in find.ref(id). And moreover, update() method on play.db.ebean.Model class (with one parameter) needs ID of model as parameter.

Hope this help solving your problem.. :)

Ensure you have commented out Ebean configuration in application.conf

# Ebean configuration
# ~~~~~
# You can declare as many Ebean servers as you want.
# By convention, the default server is named `default`
#
ebean.default="models.*"
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!