[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-5775) Support session filters in DML statements
Steve Skrla (JIRA)
noreply at atlassian.com
Fri Dec 3 14:29:13 EST 2010
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-5775?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=39284#action_39284 ]
Steve Skrla commented on HHH-5775:
----------------------------------
I am sure there are numerous reasons why this was done, and I wouldn't expect the default behavior to change in such a drastic way. However, an option to include deletes and updates in filtering would be wonderful.
> Support session filters in DML statements
> -----------------------------------------
>
> Key: HHH-5775
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5775
> Project: Hibernate Core
> Issue Type: Improvement
> Components: core, query-hql
> Reporter: Jason Clawson
>
> We are using filters to support multi-tenency, an approach alluded to in this recent blog post: http://in.relation.to/Bloggers/MultitenancyInHibernate. It works create for HQL selects but doesn't work for Updates / Deletes. Looking through the source code, this seems to have been a conscious choice as some comments indicate. If filters are meant to be used for multitenency, this seems to be the wrong choice. I would like to see session filters affect updates and deletes. This seems very logical because if I run the select: SELECT * FROM User which is affected by a filter and returns 2 users, and then execute DELETE FROM User which deletes all the users in the system--- thats not what I would expect to happen.
> I believe this will require modifications to HqlSqlWalker and the ANTLR script sql-gen.g. I am looking into what other modifications are necessary, but I would appreciate it if the Hibernate folks could take a look since they would be most familiar with the code and the decisions behind it.
> Thanks!
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list