Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] Table based multi-tenancy and many-to-many joins

Hey all,

I work for a company who has an implementation that uses Eclipselink 2.6.2 and we are now trying to implement multi-tenancy.  All of our tables currently have a discriminator field including our join tables.  This is because we ship data between different data stores for sharding and it is much easier to do if that field exists in our join tables as well.

For example, object A and object B both have tenant_id.  We have a many to many join table A_B that contains A_ID, B_ID and a tenant_id.  

How should this be modeled such that Eclipselink will populate that tenant_id for us as well as the other two join fields?  We would prefer not to create objects for AB if possible as we have a lot of these relationships now and the application currently does not manage the population of that tenant_id.  In the past we have used source or target relation keys to ensure that this field is populated.  However, with multi-tenancy, those are read only fields so that strategy fails.

Thanks for your thoughts in advance.
--


JOE WIGGINS

Principal Engineer

Workfront

Mobile  801.995.3588

joewiggins@xxxxxxxxxxxxx www.workfront.com

Address  |  Twitter  |  LinkedIn  |  Facebook

Workfront


Back to the top