-->
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: hibernate creates invalid case statement
PostPosted: Wed Mar 03, 2010 5:39 am 
Regular
Regular

Joined: Thu Dec 10, 2009 10:53 am
Posts: 50
Hibernate Annotations: 3.4.0.CR1
Hibernate Core: 3.3.0.CR1


I have a complicated inheritance hierarchy that I've been able to use with the "table per concrete class" strategy. When using the "joined" inheritance strategy hibernate creates a case statement - as a way to determine the type of a row - with 143 when-then pairs, which is more than the oracle limit of 127.

The statement is of the form:
Code:
case when this_4_.id is not null then 4 when
this_10_.id is not null then 10 when this_16_.id is not null then 16 when
this_22_.id is not null then 22 when this_29_.id is not null then 29 when
this_36_.id is not null then 36 when this_41_.id is not null then 41 when
this_48_.id is not null then 48 when this_49_.id is not null then 49 when
this_54_.id is not null then 54 when this_65_.id is not null then 65 when
[..]
when
this_123_.id is not null then 123 when this_129_.id is not null then 129 when
this_2_.id is not null then 2 when this_6_.id is not null then 6 when
this_17_.id is not null then 17 when this_131_.id is not null then 131 when
this_1_.id is not null then 1 when this_.id is not null then 0 end as clazz_0_
from PF_Objekt


Is there some way to get around this limitation without changing the inheritence hierarchy and still using the "joined" strategy?


Top
 Profile  
 
 Post subject: Re: hibernate creates invalid case statement
PostPosted: Wed Mar 03, 2010 11:27 am 
Expert
Expert

Joined: Thu Jan 08, 2009 6:16 am
Posts: 661
Location: Germany
Your hierarchy does not seam to be appropriate. Why do you want to do it that way?

_________________
-----------------
Need advanced help? http://www.viada.eu


Top
 Profile  
 
 Post subject: Re: hibernate creates invalid case statement
PostPosted: Thu Mar 04, 2010 5:00 am 
Regular
Regular

Joined: Thu Dec 10, 2009 10:53 am
Posts: 50
I wish I could change the model, but it's a standardized data model that will be used to exchange files with official institutions. That's why we can't change it.


Top
 Profile  
 
 Post subject: Re: hibernate creates invalid case statement
PostPosted: Thu Mar 04, 2010 8:52 am 
Expert
Expert

Joined: Thu Jan 08, 2009 6:16 am
Posts: 661
Location: Germany
I don't think the way you map it to the db is standardized. But that's hard to say without having more information.

_________________
-----------------
Need advanced help? http://www.viada.eu


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.