RE: Mapping Inheritance
Well, I read the documentation that there is a way to do say. But I want that when I query on Task class all objects of Task as well as Complaint should be returned, because Complaint is a sub class of Task. But document says that you cannot do so! Is there any workaround ? Thank you -Original Message- From: Muhammad Aamir Sent: Wednesday, March 03, 2004 3:08 PM To: [EMAIL PROTECTED] Subject: Mapping Inheritance How can we implement inheritance with one table for each class and tables are joined with foreign key (no duplicating columns) Thank you, Muhammad Aamir Senior Software Engineer Karachi International Container Terminal Tel: (9221) 2316401-20 Fax: (9221) 2313816 E-mail: [EMAIL PROTECTED] Website: http://www.kictl.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: mapping inheritance hierarchies????
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" <[EMAIL PROTECTED]> To: "OJB Users List" <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: mapping inheritance hierarchies????
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" <[EMAIL PROTECTED]> To: "OJB Users List" <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
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