Hi,

We want to use the ojb 1.0.3 (actually, we have the 1.0.rc5 version)
When i use this version, i have an ArrayIndexOutOfBoundsException exception.

my descriptors are :
<class-descriptor class="fr.ouestfrance.xxx.ProcedureServeur" table="proc">
        ....
        <collection-descriptor
                name="_Fonctions"
 
element-class-ref="fr.ouestfrance.xxx.FonctionParametreServeur"
                auto-retrieve="true"
                auto-update="true"
                auto-delete="true"
                orderby="nb_ordre" sort="ASC"
indirection-table="procedurefonction"
          >
                <fk-pointing-to-this-class column="id_proc"/>
                <fk-pointing-to-element-class
column="id_fonctionparametree"/>
        </collection-descriptor>
 </class-descriptor>

<class-descriptor
        class="fr.ouestfrance.xxx.FonctionParametreServeur"
        table="fonctionparametree">
        <field-descriptor name="_Id" column="id_fonctionparametree"
jdbc-type="numeric" primarykey="true" autoincrement="true" access="readonly"
/>
        ....
        <collection-descriptor  name="_Parametres"
element-class-ref="ParametreValoriseServeur"
                auto-update="true"
                auto-delete="true"
                auto-retrieve="true"
                orderby="nb_ordre" sort="ASC"
               indirection-table="fonctionparametrevalorise">
         <fk-pointing-to-this-class column="id_fonctionparametree"/>
         <fk-pointing-to-element-class column="id_parametrevalorise"/>
        </collection-descriptor>
        <reference-descriptor     name="_FonctionInstanciee"
class-ref="fr.ouestfrance.xxx.FonctionServeur"
                auto-retrieve="true"
                auto-update="false"
              auto-delete="false">
              <foreignkey field-ref="_FonctionInstanciee::_Id" />
        </reference-descriptor>
</class-descriptor>
<class-descriptor
        class="fr.ouestfrance.xxx.ParametreValoriseServeur"
        table="parametrevalorise">
        <field-descriptor name="_Id" column="id_parametrevalorise"
                             jdbc-type="numeric" primarykey="true"
autoincrement="true" access="readonly"/>
...
</class-descriptor>

java.lang.ArrayIndexOutOfBoundsException: 2
        at
org.apache.ojb.broker.accesslayer.MtoNCollectionPrefetcher.buildMtoNImplemen
torQuery(Unknown Source)
        at
org.apache.ojb.broker.accesslayer.MtoNCollectionPrefetcher.buildMtoNImplemen
torQueries(Unknown Source)
        at
org.apache.ojb.broker.accesslayer.MtoNCollectionPrefetcher.prefetchRelations
hip(Unknown Source)
        at
org.apache.ojb.broker.core.QueryReferenceBroker.performRetrievalTasks(Unknow
n Source)
        at
org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(Unknown
Source)
        at
org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(Unknown
Source)
        at
org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(Unknown
Source)
        at
org.apache.ojb.broker.core.PersistenceBrokerImpl.getCollectionByQuery(Unknow
n Source)
        at
org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionByQuery(
Unknown Source)
        at
org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionByQuery(
Unknown Source)
....

Can you explain me where it the error in my descriptor ?


When i read the src of the class, i see :
>       String[] indFkCols = getFksToThisClass();
>        String[] indItemFkCols = getFksToItemClass();
>        FieldDescriptor[] pkFields =
getOwnerClassDescriptor().getPkFields();
>        FieldDescriptor[] itemPkFields =
getItemClassDescriptor().getPkFields();
>        String[] cols = new String[indFkCols.length +
indItemFkCols.length];
>        int[] jdbcTypes = new int[indFkCols.length + indItemFkCols.length];
Do you think the last line is correct ?
Why it isnt  "int[] jdbcTypes = new int[pkFields .length + itemPkFields
.length];" ?

Thanks,

Samuel
----------------------------------------------------------------------------
-------------- 
Les informations ou pièces jointes contenues dans ce message sont
confidentielles. Seul le destinataire expressément visé peut en prendre
connaissance. Toute autre personne qui en divulguera, diffusera ou prendra
des copies sera passible de poursuites. La société Ouest-France décline en
outre, toute responsabilité de quelque nature que ce soit au titre de ce
message s'il a été altéré, déformé ou falsifié.
----------------------------------------------------------------------------
--------------

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

Reply via email to