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