-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Table per tenant
PostPosted: Thu Mar 31, 2016 8:12 am 
Newbie

Joined: Mon Mar 09, 2009 2:52 am
Posts: 4
Hi all,

Currently our company has ask us to implement a tenant per table strategy (f.i. eclipse link has that option). Looking through the options Hibernate provided are tenant per database and tenant per schema. De discriminator is not implemented but we have done that with a filter and that works as expected.

But now we must go to a situation that there is a set of tables with the tenant in the table name. We have looked to the naming strategy but that one is only called on startup. After that the table names are stored somewhere and can not be dynamic changed by a naming strategy.

A other possibility is to use StatementInspector (hibernate 5) but that is more of a workaround or a hack to change the query that goes to the database.

So is there a other possibility to having a table per tenant, so dynamically change the table name and add the tenant name into the tablename. (of cause this table must be created before it can be used.)


Top
 Profile  
 
 Post subject: Re: Table per tenant
PostPosted: Thu Mar 31, 2016 9:34 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
I guess it requires changes in the Hibernate core to accommodate a Table-based multi-tenancy strategy.
Since you already know the context, I think it's a good idea to create this new issue on the Hibernate Jira.


Top
 Profile  
 
 Post subject: Re: Table per tenant
PostPosted: Fri Apr 01, 2016 5:56 am 
Newbie

Joined: Mon Mar 09, 2009 2:52 am
Posts: 4
mihalcea_vlad wrote:
I guess it requires changes in the Hibernate core to accommodate a Table-based multi-tenancy strategy.
Since you already know the context, I think it's a good idea to create this new issue on the Hibernate Jira.


I've created https://hibernate.atlassian.net/browse/HHH-10665


Top
 Profile  
 
 Post subject: Re: Table per tenant
PostPosted: Fri Apr 01, 2016 9:36 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
Ok, thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.