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 <[email protected]> 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
>

Reply via email to