Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Multitenancy + Tenants hierarchy
Multitenancy + Tenants hierarchy [message #989696] Fri, 07 December 2012 10:43 Go to next message
David Cifuentes Garcia is currently offline David Cifuentes GarciaFriend
Messages: 2
Registered: December 2012
Junior Member
Hi all! I have a big doubt, I hope you can help me.

I'm interested to use my Java+Struts+Spring+EclipseLink application with multitenancy, I did some examples to provide multitenancy and everthing was ok.
But...

I have a weird requirement that could be possible this situation:

* Tenants A,B,C with isolated data and shared schema and using single table.

* Tenant A and B can see also data from Tenant C. But Tenant C can see just its own data as multitenancy works normally.

A real example could be a company with differents deparments using my application but some departments can see other data.

For insert data I think I can manage my code with @Multitenant(MultitenantType.SINGLE_TABLE) but I dont't know if the part of filter data is possible to be managed with eclipseLink or what solution I can use.

Thank you Wink
Re: Multitenancy + Tenants hierarchy [message #990299 is a reply to message #989696] Tue, 11 December 2012 18:25 Go to previous messageGo to next message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

I'm not sure @Multitenant supports this. You could have a different persistence unit with slightly different configuration or customizer for each tenant.

You may be able to use the @AdditionalCriteria instead of the @Multitenant, or perform your tenant isolation in your application layer, or even on the database through views.


James : Wiki : Book : Blog : Twitter
Re: Multitenancy + Tenants hierarchy [message #990796 is a reply to message #990299] Fri, 14 December 2012 10:14 Go to previous messageGo to next message
David Cifuentes Garcia is currently offline David Cifuentes GarciaFriend
Messages: 2
Registered: December 2012
Junior Member
Could be possible to use @Multitenant tag as @Multitenant(includeCriteria=false) just for insert statements?

I get to manage selects in java layer but I read in official documentation that use includeCriteria=false deactivate INSERT,UPDATE and DELETE statements for multitenancy but nothing about inserts.

I'm trying but is not working. I'm doing something wrong?
Re: Multitenancy + Tenants hierarchy [message #991519 is a reply to message #990796] Wed, 19 December 2012 16:26 Go to previous message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

The includeCriteria flag is for VPD usage (database filters rows). I don't think it will help you.

You can override the insertQuery for any descriptor using your own SQL using a DescriptorCustomizer.


James : Wiki : Book : Blog : Twitter
Previous Topic:Maven NoClassDefFound: org/eclipse/persistence/internal/libraries/asm/ClassVisitor
Next Topic:Query Money/BigDecimal Datatype
Goto Forum:
  


Current Time: Tue Nov 25 22:20:53 GMT 2014

Powered by FUDForum. Page generated in 0.44575 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software