私は grails コンソールを使って関係をいじっています。私は本の練習問題を使用していますGrails in Action
:
私は関係があります:
class User {
...
Profile profile
static hasMany = [posts: Post, tags: Tag, following: User]
...
User.get(3).addToFollowing( User.get(2) ).save()
User.list().each { print it.following }
収量
null null [com.grailsinaction.User : 2] null null
そして再び実行:
User.get(1).addToFollowing( User.get(2) ).save()
User.list().each { print it.following }
与える
[com.grailsinaction.User : 2] null null null null
最初のaddToFollowing
ものは紛失したようです...何か忘れましたか?