开发者

input data not stored in data base - why?

    //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) */

I dont understand this. It´s so simple, but it doesnt update the database. Can anyone help, please give me your vaguest shots, Im thankful for any help


Silly, but did you forget to save?

If you did, user.save(flush:true) should do the trick.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜