-->
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.  [ 2 posts ] 
Author Message
 Post subject: Table per concrete class without using UNION
PostPosted: Wed Jun 15, 2005 4:41 am 
Beginner
Beginner

Joined: Tue Apr 05, 2005 12:09 pm
Posts: 48
Location: Slovakia (SK), Košice (KE)
Hibernate version: 3.0.5

Hi

Imagine 2 classes: Foo with field foo and Bar with field bar. Both classes are ingerited from abstract FooBar with field id. Now I want to use inheritance using "Table per concrete class". Hibernate generates:

Code:
select id, foo, null as bar from Foo union all select id, null as foo from Bar


It is fine but until I have more subclasses with more different properties. Then the generated select is pretty long and maybe not so effective. Is it possible using Hibernate to generate?:

Code:
select id, foo, bar from Foo outer join Bar on Foo.id = Bar.id


Yeah .. this is similar to "Table per subclass", but I don't need any "parent" DB table (that "Table per subclass" actually requires). It would be also nice to use discriminator in "Table per concrete class".

Any suggestions?
Thanks.

PS: my problem is mostly due to: http://forum.hibernate.org/viewtopic.php?t=943799

_________________
Martin


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 15, 2005 4:43 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Consider our commercial support offerings, please.


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