-->
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.  [ 3 posts ] 
Author Message
 Post subject: Possible to map extended classes COMPLETLY to seperate table
PostPosted: Fri Sep 26, 2003 3:40 am 
Newbie

Joined: Fri Sep 26, 2003 3:29 am
Posts: 3
Hi,

is it possible to map extended classes completly to seperate tables?

I have

class A
class B extends A
class C extends A

I want to map B to table "b" with all all attributes of A+B, similar for C

I do not need a table for A (A is abstract, so does not help)
I do not want B to be joined over table "a" and "b"
I would like to define all properties of A in its mapping file and extend on these in the mapping file of B.

Well, it is kind of an inheritance of mapping files...

Ist this possible?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 26, 2003 3:49 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Not directly but you can use the standard XML include feature. Hibernate will not care as it is an XML feature.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 26, 2003 4:08 am 
Newbie

Joined: Fri Sep 26, 2003 3:29 am
Posts: 3
OK, I can use that to improve th mapping file situation.

But now I have seperate classes, which is a problem, as

A is my persistent base class
B is contained in a collection/set (inverse=true)
the collection/set is once contained in B itself and once in C

now the contained element needs a property and a many-to-one mapping for each possible parent. not nice. I want only one parent of type A, as all are extended from this. But A being abstract is not mapped, only its attributes contained in the mapping of B and C.

What is the solution?

subclass is not, as unpractical in a larger project for ALL classes and I need seperate tables

joined-subclass is not, it does split my tables and is still all in one mapping file.

???


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