Thanks for your answer.

I need the inId because its like ebay: in each productgroup there is a collection of "untergruppen/undergroups". And this works: i could add objects of produktgruppe and save them (so inId will store the reference to the main productgroup).

The problem is not between productgroup and productgroup (1:n) - it is between Productgroup and Product (n:m)

And why did i got a arithmetic exception (/ by zero) from the ojb core??

I found also something strange:
The OJB Framwork and my Application runs in a Tomcat environment.
If i start tomcat and then my app - i got the error! If i start my app a seconde time everthing works fine ...


Thanks for help, Thomas


Thomas Franke schrieb:

Thomas Papke wrote:

Why you need the inId?


Here is my descriptor of the two classes:

<class-descriptor
   class="de.ba.studi.chtp.model.Produktgruppe"
   table="Produktgruppe"
 >
   <field-descriptor
       name="id"
       column="id"
       jdbc-type="INTEGER"
       primarykey="true"
       autoincrement="true"
   >
   </field-descriptor>
   <field-descriptor
       name="inId"
       column="inId"
       jdbc-type="INTEGER"
   >
   </field-descriptor>
   <field-descriptor
       name="name"
       column="name"
       jdbc-type="VARCHAR"
   >


I thing this can't work and I thing also it is a wrong design:

   </field-descriptor>
   <collection-descriptor
      name="produktgruppen"
      element-class-ref="de.ba.studi.chtp.model.Produktgruppe"
      orderby="inId"
      sort="DESC"
      auto-retrieve="true"
      auto-update="true"
      auto-delete="true"
   >
      <inverse-foreignkey field-ref="inId"/>
   </collection-descriptor>



   <collection-descriptor
      name="produkt"
      element-class-ref="de.ba.studi.chtp.model.Produkt"
      auto-retrieve="true"
      auto-update="true"
      indirection-table="produkt_produktgruppe"
 >
      <fk-pointing-to-this-class column="ProdGruppe_id"/>
      <fk-pointing-to-element-class column="Prod_Id"/>
 </collection-descriptor>
</class-descriptor>


Take into your Produkt class a collection descriptor with Produktgruppe classes.
For that case I would write a spezial mapping for Produktgruppe without a collection with Produkt class.


<class-descriptor
   class="de.ba.studi.chtp.model.Produkt"
   table="Produkt"
 >
   <field-descriptor
       name="id"
       column="id"
       jdbc-type="INTEGER"
       primarykey="true"
       autoincrement="true"
   >
   </field-descriptor>
   <field-descriptor
       name="name"
       column="name"
       jdbc-type="VARCHAR"
   >
   </field-descriptor>


<collection-descriptor name="meinung" element-class-ref="de.ba.studi.chtp.model.Meinung" auto-retrieve="true" auto-update="true" > <inverse-foreignkey field-ref="prod_id"/> </collection-descriptor> </class-descriptor>


---------------------------------------------------------------------
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]



Reply via email to