You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Cesar <ce...@uol.com.br> on 2003/07/24 21:03:43 UTC

mapping inheritance hierarchies????

People
I have two tables(A and B) in my Database where  A extends A


     

    
How I make to map these class in the XML file?
I already tried the suggested solution of 1:1 in tutorial3.html but it did´nt work 

Re: mapping inheritance hierarchies????

Posted by Thomas Cornet <th...@cornet.name>.
   Hello Cesar,

Such inheritance mappings isn't supported in the current OJB version. My 
old schema was this kind of way, and I had to spend much hours to update my 
database's structure and its content. You may keep your current structure, 
but you won't be able to use inheritence within OJB.

What I've done is (following your example) is :

TABLE_A (ID, VALUE_A)
TABLE_B (ID, VALUE_A, VALUE_B)

And it's working quite well...

Thomas

At 00:37 25/07/2003, you wrote:
>Hi Cesar,
>
>hmm, I rather think I don't understand your problem.
>Declare all persistent classes in separate
>class-descriptor. If  you need A and B objects to
>persist, declare a class-descriptor for each class
>(with all persistent fields, e.g. B need three field-descriptor).
>If you want to ask OJB for all A objects inclusive all inherited
>objects use the 'extent-class' tag in A to declare the extended
>classes.
>More info
>http://db.apache.org/ojb/tutorial3.html#extents and polymorphism
>
>regards,
>Armin
>
>----- Original Message -----
>From: "Cesar" <ce...@uol.com.br>
>To: "OJB Users List" <oj...@db.apache.org>
>Sent: Thursday, July 24, 2003 10:41 PM
>Subject: Re: mapping inheritance hierarchies????
>
>
>Sorry B extends A
>
>[ ]´s
>   ----- Original Message -----
>   From: Cesar
>   To: OJB Users List
>   Sent: Thursday, July 24, 2003 4:03 PM
>   Subject: mapping inheritance hierarchies????
>
>
>   People
>   I have two tables(A and B) in my Database where  A extends A
>
>
>
>
>
>   How I make to map these class in the XML file?
>   I already tried the suggested solution of 1:1 in tutorial3.html but it
>did´nt work
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>For additional commands, e-mail: ojb-user-help@db.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: mapping inheritance hierarchies????

Posted by Armin Waibel <ar...@code-au-lait.de>.
Hi Cesar,

hmm, I rather think I don't understand your problem.
Declare all persistent classes in separate
class-descriptor. If  you need A and B objects to
persist, declare a class-descriptor for each class
(with all persistent fields, e.g. B need three field-descriptor).
If you want to ask OJB for all A objects inclusive all inherited
objects use the 'extent-class' tag in A to declare the extended
classes.
More info
http://db.apache.org/ojb/tutorial3.html#extents and polymorphism

regards,
Armin

----- Original Message -----
From: "Cesar" <ce...@uol.com.br>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Thursday, July 24, 2003 10:41 PM
Subject: Re: mapping inheritance hierarchies????


Sorry B extends A

[ ]´s
  ----- Original Message -----
  From: Cesar
  To: OJB Users List
  Sent: Thursday, July 24, 2003 4:03 PM
  Subject: mapping inheritance hierarchies????


  People
  I have two tables(A and B) in my Database where  A extends A





  How I make to map these class in the XML file?
  I already tried the suggested solution of 1:1 in tutorial3.html but it
did´nt work



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: mapping inheritance hierarchies????

Posted by Cesar <ce...@uol.com.br>.
Sorry B extends A

[ ]´s
  ----- Original Message ----- 
  From: Cesar 
  To: OJB Users List 
  Sent: Thursday, July 24, 2003 4:03 PM
  Subject: mapping inheritance hierarchies????


  People
  I have two tables(A and B) in my Database where  A extends A


       

      
  How I make to map these class in the XML file?
  I already tried the suggested solution of 1:1 in tutorial3.html but it did´nt work