Multi-tenancy & discriminator column

Hello everybody,

imagine we will save the data of two booksellers in one database and one scheme, tenantid 001 is assigned to the first, 002 is assigned to the second bookseller.
Therefore I´m trying to create a multi-tenant system for one database and one database scheme. So I need a tenantid in almost every table, included to the primary key.

While trying to realize this concept I´m forcing multiple problems, so here is a simple example:

http://www.caspier.de/vp/erd3.jpg

Both tenantids are marked as discriminator columns. Creating the ORM-model we will receive the following diagram:

http://www.caspier.de/vp/class3.jpg

So far so good. The tenantid attribute is excluded from the orm PK.

Problem 1:
When I´m now trying to generate the code, I receive the following error:
[19:09:13] [Error] No Name: DBForeignKey (shelf => book)'s column(s) must either all are not primary key or all are part of primary key.

Problem 2:
For testing purposes I removed the tanantid from the primary key and took a look at the generated JPA code. I was not able to find any annotation for the discriminator column (@DISCRIMINATOR COLUMN).

Any Idea how to transpose such an multi-tenant system in VP?
The next problem is to create n-m mapped tables, but this should be the next step :slight_smile:
(Version 11 Build20140304)

Thanks in advance for your tips!
Regards,
Vincent