Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-dev] Multi-tenant using shared schema doc

The annotations should be separate and the XML should be embedded. I believe this is a common pattern in JPA.


On 2011-03-15, at 8:36 AM, Guy Pelletier <guy.pelletier@xxxxxxxxxx> wrote:

Well I got confused since in the XML (from previous discussions and examples) the tenant discriminators were within <multitenant> so I was trying to be consistent. The XML should be separated as well then?

I was thinking within the same annotation would be cleaner and mimic things DiscriminatorColumn where length only applies when the type is STRING.

Just to work through having the metadata separate though, means our minimal configuration can be one of the three:

- @Multitenant
- @TenantDiscriminator
- @TenantDiscriminators

Then further expanded when we add support for TABLE_PER_TENANT
- @TenantTableDiscriminator(??)

Or is it intended that all entities that use multi-tenancy must at least declare @Multitenant (again I'm working from previous discussions and examples)


On 14/03/2011 8:06 PM, douglas clarke wrote:

Looking at the example:
  type = SINGLE_TABLE,
  tenantDiscriminators = @TenantDiscriminator(name=“tenant-id”, columnName=“TENANT_ID”)

I am not sure I like the discriminators being within the @Multitenant annotation. It implies that all strategies will have a TennatDiscriminator with the same structure.

The idea was to mimic the inheritance which is configured like:

@DiscriminatorColumn(name="DISC", discriminatorType=STRING,length=20)

So, I was thinking we could do something like:

@TenantDiscriminatorColumn(name="COMPANY", discriminatorType=STRING,length=20, property="company-id")

This sets us up for handling multitenancy where each tenant's rows for a given entity arte stored in different tables identified with different names or schema.



On 14/03/2011 3:51 PM, Guy Pelletier wrote:
I've gone through another round of updating the multi-tenancy doc.

It is still a work in progress, however I think we are getting closer. Please review and provide any feedback.


_______________________________________________ eclipselink-dev mailing list eclipselink-dev@xxxxxxxxxxx
_______________________________________________ eclipselink-dev mailing list eclipselink-dev@xxxxxxxxxxx
eclipselink-dev mailing list

Back to the top