1
votes

I'm trying to create a multi-tenant application with shared schema.We have identified a discriminator field which will help to filter out data base on customers.

I'm facing a problem in TableGenerator strategy for generating primary keys for some of the entities.

As per logic we will have 2 columns for seq_name and another(seq_count) for tracking the count.

But since its multitenant application i need to keep them separate for each customer. So multiple customers will have seq_name & seq_count columns which would belong to them respectively.

I was thinking that i might have to write some custom logic for TableGenerator with a attribute for discriminator column, but before that i need some advice that is their any other way to do this?

If writing your own (multi-tenant aware) allocator is all you have to do, that's easy! I have my own Hibernate allocators, anyway.Thomas W