| Are there any plans for when this will be supported? We have a requirement coming up to support multitenancy in one of our applications and I was hoping Hibernate would come to my rescue. I'll describe my understanding or expectation of how it would work so that I make sure that what I'm expecting is what is being proposed here.
- Define a tenant descriminator column name for each of the entities that would be affected. We use XML mappings so it would be in the mapping file for us.
- At the beginning of the request, open the Session with the correct descriminator value. We use the OSIV pattern so I would write a Spring filter or extend the existing one to set this value.
- All data queried would then be magically filtered.
Sounds simple right? Just kidding. That's really more of a praise to you guys for the complexity you hide for all of us other developers out here. If this is not being worked on at the moment, are there any recommendations for a solution that would buy us 80-90% of the functionality right now out of the box? Otherwise, I'm going to have to touch lots of queries and DAO objects to get this done. Thanks! |