-->
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.  [ 12 posts ] 
Author Message
 Post subject: Hibernate HT_ Tables ON JOINED inheritance
PostPosted: Tue Mar 22, 2016 11:26 am 
Newbie

Joined: Tue Mar 22, 2016 10:02 am
Posts: 5
Hi,

I´m trying to migrate an application from Hibernate 3 to Hibernate 5 and after complete the required changes on java code, when i deploy the application
I´m watching how Hibernate is trying to create HT_ tables one for each @Inheritance annotated entity.

Searching on google I found why the tables are being created :http://in.relation.to/2005/07/20/multitable-bulk-operations/.

But in my case we are not allow to change de database to add new tables.

My Inheritance model only has one level of Inheritance and its simple, https://imagebin.ca/v/2b8fz1IrTnEt.

Does any know any alternative representation for a hierarchical table structure that i can use to avoid the HT_ tables creation?.

Thank you.


Top
 Profile  
 
 Post subject: Re: Hibernate HT_ Tables ON JOINED inheritance
PostPosted: Tue Mar 22, 2016 12:10 pm 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1630
Location: Romania
Those are temporary tables only and not permanent ones. For this reason, I don;t see why you shouldn't create them.
You can avoid the bulk delete queries and then you won't have to use them.


Top
 Profile  
 
 Post subject: Re: Hibernate HT_ Tables ON JOINED inheritance
PostPosted: Tue Mar 22, 2016 12:25 pm 
Newbie

Joined: Tue Mar 22, 2016 10:02 am
Posts: 5
I know that the HT_ are global temporary but our client don´t allows to create new tables on his database, we don´t have authorization
and we have to look for other alternatives.

Can you tell me if there is any way to avoid the creation of the HT_ tables?. We can change the inheritance hierarchy on our entities or the Hibernate configuration. We can also asume a exception on deploy caused by the non creation of the tables if it´s non blocking for the rest of the deploy.

I know that it´s tricky to understand but for us it´s easier to change the inheritance hierarchy configuration than negotiate new privilegies with the client.


Top
 Profile  
 
 Post subject: Re: Hibernate HT_ Tables ON JOINED inheritance
PostPosted: Wed Mar 23, 2016 8:53 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1630
Location: Romania
I found a very interesting solution for this problem.

Check out this GitHub project. I'm going to add a proposal so that we integrate such strategy into Hibernate Core.

I managed to build a proof of concept that works on Hibernate 5.


Top
 Profile  
 
 Post subject: Re: Hibernate HT_ Tables ON JOINED inheritance
PostPosted: Wed Mar 23, 2016 9:07 am 
Newbie

Joined: Tue Mar 22, 2016 10:02 am
Posts: 5
Thank you so much.

I'm going to try this solution.


Top
 Profile  
 
 Post subject: Re: Hibernate HT_ Tables ON JOINED inheritance
PostPosted: Wed Mar 23, 2016 9:14 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1630
Location: Romania
I can submit a PR to that project on GitHub to support Hibernate 5 too, but first it needs a LICENSE.
Even so, it's not integrated with Maven Central.


Top
 Profile  
 
 Post subject: Re: Hibernate HT_ Tables ON JOINED inheritance
PostPosted: Wed Mar 23, 2016 9:24 am 
Newbie

Joined: Tue Mar 22, 2016 10:02 am
Posts: 5
You're right, but for us it's a new available option and we can walk a bit on this way.

Thank you again.


Top
 Profile  
 
 Post subject: Re: Hibernate HT_ Tables ON JOINED inheritance
PostPosted: Wed Mar 23, 2016 9:44 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1630
Location: Romania
You're welcome.


Top
 Profile  
 
 Post subject: Re: Hibernate HT_ Tables ON JOINED inheritance
PostPosted: Thu Mar 24, 2016 2:29 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1630
Location: Romania
My PR was merged into this GitHub project so now you can use the Hibernate 5 module if you want too. Let me know how that works for you.


Top
 Profile  
 
 Post subject: Re: Hibernate HT_ Tables ON JOINED inheritance
PostPosted: Mon Mar 28, 2016 7:24 am 
Newbie

Joined: Tue Mar 22, 2016 10:02 am
Posts: 5
Hi,

Today I`ve downloaded the GitHub project, and after built the jar, and fix the Hibernate configuration, no temporary table creation was fired on deploy.

Works fine for me.

We still have to check if there is any collateral issue inside the application, but for me looks like a valid solution.

I will post any problem on this topic if we found any issue during our tests, related to the library.

Thanks again for your time.


Top
 Profile  
 
 Post subject: Re: Hibernate HT_ Tables ON JOINED inheritance
PostPosted: Mon Mar 28, 2016 10:53 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1630
Location: Romania
I'm glad it worked for you ;)


Top
 Profile  
 
 Post subject: Re: Hibernate HT_ Tables ON JOINED inheritance
PostPosted: Wed Feb 01, 2017 12:27 pm 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1630
Location: Romania
We now support non-temporary tables bulk-id strategies. Check out [this article on our blog](http://in.relation.to/2017/02/01/non-te ... trategies/).


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 12 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.