[hibernate-issues] [Hibernate-JIRA] Created: (HHH-5775) Support session filters in DML statements

Jason Clawson (JIRA) noreply at atlassian.com
Fri Dec 3 14:18:13 EST 2010


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