As it was said to me a few days ago, don't work with Vector but only the
interface Collection or List.
It will work then.
Christophe
----- Original Message -----
From: "Timofey Korolev" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
Sent: Saturday, June 28, 2003 7:39 PM
Subject: complex class prolem
> Hello there!
> I'm new to OJB. I've tried a simple O/R mapping and it worked, but when
> i've tried to map real life objects i got a problem.
>
> There are three classes:
>
> LOMGeneralObject & LOMGeneralLanguage & LangString:
>
> public class LOMGeneralObject {
> private BigDecimal identifier;
> private LangString title;
> private BigDecimal titleId;
> private Vector language;
> .....
> }
>
> public class LOMGeneralLanguage {
> BigDecimal id;
> String language;
> LOMGeneralObject gen_object;
> BigDecimal gid;
> ......
> }
>
>
> public class LangString {
> BigDecimal id;
> String string;
> String language;
> ....
> }
>
> there are also some SQL tables (postgres) for them:
>
> TABLE GENERAL:
> IDENTIFIER SERIAL PRIMARY KEY
> TITLE DECIMAL(10,0)
>
> TABLE LANGSTRING:
> ID SERIAL
> LANGUAGE VARCHAR
> STRING VARCHAR
>
> TABLE GENERAL_LANGUAGE:
> ID SERIAL PRIMARY KEY
> LANGUAGE VARCHAR
> GID DECIMAL(10,0)
>
>
> and here goes XML-mapping for them:
>
> <class-descriptor class="ru.chemnet.lom.LOMGeneralObject"
> table="GENERAL" >
>
> <field-descriptor name="identifier" column="identifier"
> sequence-name="general_identifier_seq" jdbc-type="NUMERIC"
> autoincrement="true" primarykey="true" />
>
> <field-descriptor name="titleId" column="title"
> jdbc-type="NUMERIC"/>
>
> <reference-descriptor name="title"
> class-ref="ru.chemnet.lom.LangString" auto-retrieve="true"
> auto-update="true" auto-delete="true" >
>
> <foreignkey field-ref ="titleId" />
>
> </reference-descriptor>
>
> <collection-descriptor name="language"
> element-class-ref="ru.chemnet.lom.LOMGeneralLanguage" orderby="id"
> sort="DESC" >
> <inverse-foreignkey field-ref="gid"/>
> </collection-descriptor>
> </class-descriptor>
>
> <class-descriptor class="ru.chemnet.lom.LangString" table="LANGSTRING" >
> <field-descriptor name="id" column="id" jdbc-type="NUMERIC"
> autoincrement="true" primarykey="true"
> sequence-name="langstring_id_seq" />
> <field-descriptor name="language" column="language"
> jdbc-type="VARCHAR" />
> <field-descriptor name="string" column="string"
> jdbc-type="VARCHAR" />
> </class-descriptor>
>
> <class-descriptor class="ru.chemnet.lom.LOMGeneralLanguage"
> table="GENERAL_LANGUAGE">
> <field-descriptor name="id" column="id" jdbc-type="NUMERIC"
> autoincrement="true" primarykey="true"
> sequence-name="general_language_id_seq" />
> <field-descriptor name="language" column="language"
> jdbc-type="VARCHAR"/>
> <field-descriptor name="gid" column="gid" jdbc-type="NUMERIC"/>
> <reference-descriptor name="gen_object"
> class-ref="ru.chemnet.lom.LOMGeneralObject" auto-retrieve="true"
> auto-update="true" auto-delete="true">
> <foreignkey field-ref="gid"/>
> </reference-descriptor>
> </class-descriptor>
>
>
> The problem is that I try to make LOMGeneralObject and to store it.
> title field of LOMGeneralObject stores to LANGSTRING table perfectly,
> but
> LOMGeneralObject.title of Vector type doesn't make any records in
> GENERAL_LANGUAGE at all.
>
> I've read Advanced O/R mapping tutorial for hundred times and still
> cannot find out what' wrong.
> May be someone can help me? Thank you.
>
>
>
> --
> Regards,
> CEO Linux-Online.Ru
> Korolyov Timofey
>
> www.linuxshop.ru :: www.prefnews.ru :: www.dotstyle.ru
>
> JabberID: [EMAIL PROTECTED]
>
---
Ce message Envoi est certifi� sans virus connu.
Prot�g� par l'antivirus AVG Deluxe.
Version: 6.0.492 / Base de donn�es virus: 291 - Date: 24/06/2003
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]