Hi,

i want to store a class which extends an AbstractClass in two Tables.
For this, i tried it with the samle from apache.org.
If a make an Query for Class B, i get the object and the superfields where
filld.

But if i try to to store B the table A where not filled.
Can anyone help?

package de.intermediate.epic;

Class A:
===========================================
public class B extends A
{
    int my_id;                      // id is the primary key
    int ref_ID;                     // aID is the foreign key referencing
A.id
    int someValueFromB;       // mapped to a column in B_TABLE

    public int getSomeValueFromB() {        return someValueFromB;    }
    public void setSomeValueFromB(int someValueFromB) {
this.someValueFromB = someValueFromB;    }
    public int getMy_id() {        return my_id;    }
    public void setMy_id(int my_id) {        this.my_id = my_id;    }
    public int getRef_ID() {        return ref_ID;    }
    public void setRef_ID(int ref_ID) {        this.ref_ID = ref_ID;    }
}


Class B:
===========================================

package de.intermediate.epic;

public class A
{
    int ida;                        // primary key
    int someValueFromA;       // mapped to a column in A_TABLE

    public int getSomeValueFromA() {        return someValueFromA;    }
    public void setSomeValueFromA(int someValueFromA) { this.someValueFromA
= someValueFromA; }
    public int getIda() { return ida; }
    public void setIda(int ida) { this.ida = ida;}
}


Repository
===========================================
<class-descriptor class="de.intermediate.epic.A" table="A_TABLE"  >

      <field-descriptor
         name="ida"
         column="ID"
         jdbc-type="INTEGER"
         primarykey="true"
         autoincrement="true"/>

      <field-descriptor
         name="someValueFromA"
         column="someValueFromA"
         jdbc-type="INTEGER"/>
   </class-descriptor>

   <class-descriptor
      class="de.intermediate.epic.B"
      table="B_TABLE">
      <field-descriptor
         name="my_id"
         column="my_id"
         jdbc-type="INTEGER"
         primarykey="true"
         autoincrement="true"/>

      <field-descriptor
         name="ref_ID"
         column="A_ID"
         jdbc-type="INTEGER"/>

      <field-descriptor
         name="someValueFromB"
         column="someValueFromB"
         jdbc-type="INTEGER"/>

      <reference-descriptor name="super"
           class-ref="de.intermediate.epic.A">
         <foreignkey field-ref="ref_ID" />
      </reference-descriptor>
   </class-descriptor>

-------------------------------------------------------------------------

I N T E R M E D I A T E GmbH & Co. KG
eSolutions & Integration

Durmersheimer Stra�e 55     t +49 (0)721.98644-50
76185 Karlsruhe             f +49 (0)721.98644-99
http://www.intermediate.de

P.S. Als Beratungs- und Systemhaus optimiert Intermediate die
Gesch�ftsprozesse mittelst�ndischer Unternehmen in Vertrieb,
Marketing und Kundenservice.
T�tigkeitsschwerpunkte sind Angebots- und Produkt-Konfiguration
sowie Enterprise Content-Management-Systeme.
Unsere besondere St�rke liegt in der Integration bestehender
Systeme, insbesondere von ERP-Systemen wie SAP R/3, BRAIN AS,
MAS90 etc.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to