cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Gentry <mgen...@masslight.net>
Subject Re: Multi tenacy with schema per tenant with 'some' tables shared
Date Wed, 23 Dec 2015 13:52:37 GMT
Hi Emanuele,

I'm not entirely certain of your question.  Why is it you do not want
relationships from your Company entities to your Shared entities?

mrg


On Mon, Dec 21, 2015 at 4:18 PM, emanuele m <emamaia73@gmail.com> wrote:

> Actually i have an application
> using cayenne 3.1 stack, with postgress 9.3 as database,
>  that implements multiteancy creating
> a separate ServerRuntime per "Company" that relocates
> DbEntities on a specific postgress schema, using an
> XMLDataMapLoader with overrided load method as follow:
>
> public DataMap load(Resource configurationResource) {
>         DataMap map = super.load(configurationResource);
>         map.setDefaultSchema(tenantSchema);
>         for (DbEntity e : map.getDbEntities()) {
>             e.setSchema(tenantSchema);
>                 String sequence =
>
> tenantSchema.concat(".").concat(e.getPrimaryKeyGenerator().getGeneratorName());
>                 e.getPrimaryKeyGenerator().setGeneratorName(sequence);
>
>         }
>
>         return map;
> }
>
> As result i have a serverruntime per "Company" from which every user
> obtains his own ObjectContext(s).
>
> Now i would need to map some tables into a shared schema.
>
> Was thinking about to point just the tables that must be separated per
> company, into the company specific schema, leaving those that are meant to
> be share into the public schema.
> Clearly there are no relationships between the "shared" entities and the
> "Company" ones.
>
> Any advice orsuggestions will be greatly appreciated.
>
> Thanks,
> Emanuele
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message