This content has been marked as final.
Show 20 replies
-
15. Re: Data separation in multi tenant applications with seam
gavin.king May 31, 2007 5:21 PM (in response to christian_zeidler)Oh, by the way, all this is totally unnecessary. You don't need two EMs at all. All you need is this:
<core:filter name="clientFilter" enabled="#{identity.loggedIn}"> <core:name>clientFilter</core:name> <core:parameters> <key>clientId</key> <value>#{clientId}</value> </core:parameters> </core:filter>
It's really as easy as that :-) -
16. Re: Data separation in multi tenant applications with seam
gavin.king May 31, 2007 5:22 PM (in response to christian_zeidler)Anyway, hopefully you learned some things about factories and context variabled along the way.
-
17. Re: Data separation in multi tenant applications with seam
christian_zeidler Jun 4, 2007 4:17 PM (in response to christian_zeidler)Thank you Gavin!
That's a sweet solution - very seam-like :)
What we discussed along the way will be helpfull for implementing strategies #2 and #3 for data separation...
Thanks again! -
18. Re: Data separation in multi tenant applications with seam
gavin.king Jun 4, 2007 4:26 PM (in response to christian_zeidler)very seam-like :)
Yes, do you start to feel what I mean when I talk about Seam-style loose-coupling?
It really takes people a while to start to get into the swing of not writing "orchestration" code, and just writing components that take care of their own business and react naturally to events that occur in the world around them, without really knowing what's causing or driving these events.
It's something I will never really be able to explain, you have to see it and feel it. But it really increases reusability and helps reduce LOC. -
19. Re: Data separation in multi tenant applications with seam
garypinkham Jun 29, 2007 6:31 PM (in response to christian_zeidler)"gavin.king@jboss.com" wrote:
Oh, by the way, all this is totally unnecessary. You don't need two EMs at all. All you need is this:<core:filter name="clientFilter" enabled="#{identity.loggedIn}"> <core:name>clientFilter</core:name> <core:parameters> <key>clientId</key> <value>#{clientId}</value> </core:parameters> </core:filter>
It's really as easy as that :-)
Just curious.. Is there a way to attach the filter to all of the entities without the annotations shown in the other posting? I had originally thought of doing it via an aspect but I like the idea of the filters shown here. I'd like to avoid the annotations on every entity. (I guess I'm lazy!! :-) )
Thanks!!!
Gary
PS. I guess I shouldn't say "every" entity. There will be ones excluded... -
20. Re: Data separation in multi tenant applications with seam
gavin.king Jun 29, 2007 8:52 PM (in response to christian_zeidler)There is a concept of a "default restriction" for a filter in Hibernate XML. Not sure about the annotationized version. Ask Emmanuel.