You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@PostAction("/save")
publicvoidupdate(Useruser) {
ebeanDao.saveOrUpdate(user);
// if user.id == null, insert user to database.// if user.id != null,update user fields(not null) by user.id,if user.name is null,don't update user.name
}
@PostAction("/save")
publicvoidupdate(Useruser) {
//now, i have to do like this:Useru = ebeanDao.getById(user.id);
if(user.name!=null){
u.name = user.name;
}
if(user.age!=null){
u.age = user.age;
}
// ... if user has other fieldsebeanDao.save(u);
}
The text was updated successfully, but these errors were encountered:
like this:
The text was updated successfully, but these errors were encountered: