//gets the correct User (checked with printlns)
def user = User.get(params.user?.toString())
println "usern.nickname " + user.id + " " + user.nickname
println "user "+user
/*
* write in database
*/
user.nickname = params.nickname
user.email = params.email
/* a println of user.nickname shows the same as params.nickname, but the database
is not being updated with the value (params.nickname) */
我不明白这一点。这很简单,但它不会更新数据库。任何人都可以帮忙,请给我你最模糊的镜头,我感谢任何帮助
答案 0 :(得分:6)
如果你这样做,user.save(flush:true)
应该做到这一点。