Groups
Groups
Sign in
Groups
Groups
Grails联盟-GrailsUnion
Conversations
About
Send feedback
Help
{domain}怪异的需求:如何禁止一个domain做插入操作?
1 view
Skip to first unread message
Alex wang
unread,
Nov 29, 2009, 12:14:06 AM
11/29/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to grail...@googlegroups.com
看到一个哥们提出希望能有禁止插入操作的domain方式(比如这个数据库是只读的),防止写入脏数据
一个解决方案是:
def beforeInsert = {
throw new UnsupportedOperationException("This class is transient")
}
除了这个还有没有别的方式了
---------------------------------------------
Alex wang
website:颠覆软件
http://www.foxlog.org
twitter:
http://twitter.com/foxlog
douban:
http://www.douban.com/people/foxlog
gmail: idea.wang[at]
gmail.com
Liu Chao
unread,
Nov 29, 2009, 12:15:52 AM
11/29/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to grail...@googlegroups.com
这都什么幺蛾子。。。
直接把数据库访问权限改了得了
2009/11/29 Alex wang
<
idea...@gmail.com
>
Alex wang
unread,
Nov 29, 2009, 12:17:00 AM
11/29/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to grail...@googlegroups.com
假定数据库你不能碰,哈哈
---------------------------------------------
Alex wang
website:颠覆软件
http://www.foxlog.org
twitter:
http://twitter.com/foxlog
douban:
http://www.douban.com/people/foxlog
gmail: idea.wang[at]
gmail.com
2009/11/29 Liu Chao
<
liuc...@gmail.com
>
Liu Chao
unread,
Nov 29, 2009, 12:20:56 AM
11/29/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to grail...@googlegroups.com
就不能让数据库提供一个只读用户用来访问?
2009/11/29 Alex wang
<
idea...@gmail.com
>
wang xin
unread,
Nov 29, 2009, 1:31:03 AM
11/29/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to grail...@googlegroups.com
http://www.grails.org/GORM+-+Mapping+DSL
Domain Mapping的文档里,有讲到,可以设成readonly 的。
2009/11/29 Liu Chao
<
liuc...@gmail.com
>
--
Xin Wang
xinw...@gmail.com
Liu Chao
unread,
Nov 29, 2009, 1:49:44 AM
11/29/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to grail...@googlegroups.com
那是二级缓存吧。。。
2009/11/29 wang xin
<
xinw...@gmail.com
>
wang xin
unread,
Nov 29, 2009, 2:50:22 AM
11/29/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to grail...@googlegroups.com
我试过,如果用了这个,domain就变成只读的了。
2009/11/29 Liu Chao
<
liuc...@gmail.com
>
--
Xin Wang
xinw...@gmail.com
Alex wang
unread,
Nov 29, 2009, 3:28:45 AM
11/29/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to grail...@googlegroups.com
我看文档也是针对cache的
2009/11/29 wang xin
<
xinw...@gmail.com
>
phoenix clt
unread,
Nov 29, 2009, 9:16:28 AM
11/29/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to grail...@googlegroups.com
正常情况下是没有脏数据写入吧,除非是 应用的程序有问题,故意往里写数据了。
2009/11/29 Alex wang
<
idea...@gmail.com
>
Reply all
Reply to author
Forward
0 new messages