This one time, at band camp, Luca Dall'Olio said:

LD>I am having some trouble in executing a simple Oql query that contains 
LD>implicit joins.
LD>
LD>Reading JDO faqs from exolab I suppose implicit joins *are* supported, 
LD>but I can't make them work.
LD>
LD>
LD>The exception is an ArrayIndexOutOfBoundsException and is thrown by the 
LD>execute method, following are code and mapping.
LD>
LD>Thank you in advance for any suggestion. I would like to thank you for 
LD>providing Castor. We are introducing it in our company and it is 
LD>"cleaning" our code from the sql pollution :-) !
LD>
LD>bye, Luca Dall'Olio [EMAIL PROTECTED]
LD>
LD>
LD>
LD>The code is :
LD>
LD>     Database db = _jdo.getDatabase();
LD>
LD>             db.begin();
LD>
LD>
LD>             // Look up the products and if found in the database,
LD>             // delete them from the database
LD>             String val="mandato_semplice";
LD>             OQLQuery catOql = db.getOQLQuery(
LD>                             "SELECT p FROM
LD>it.unimaticaspa.unimoney.document.entity.Category p WHERE p.iter.iter =
LD>$1"); //
LD>             catOql.bind("mandato_semplice");
LD>             QueryResults  results = catOql.execute();
LD>             db.commit();
LD>             db.close();
LD>
LD>
LD>
LD>
LD>The mapping is:
LD>
LD>
LD>
LD>
LD>
LD>
LD><!-- ITER ITER ITER ITER ITER -->
LD>   <class name="it.unimaticaspa.unimoney.document.entity.Iter"
LD>          identity="familyName iter">
LD>     <map-to table="tb_itr_iter" />
LD>         <field name="familyName" type="string">
LD>           <sql name="fam_family" type="char" />
LD>         </field>
LD>         <field name="iter" type="string">
LD>           <sql name="itr_iter" type="char" />
LD>         </field>
LD>         <field name="types"
LD>                 type="it.unimaticaspa.unidoc.document.DocumentType"
LD>                 lazy="false"
LD>                 collection="collection">
LD>             <sql many-table="TB_IDT_ITER_DOCUMENT_TYPE" />
LD>         </field>
LD>
LD>         <field name="categories"
LD>                 type="it.unimaticaspa.unimoney.document.entity.Category"
LD>                 lazy="false"
LD>                 collection="collection">
LD>             <sql many-key="fam_family itr_iter" />
LD>         </field>
LD>   </class>
LD>
LD><!--CATEGORY CATEGORY CATEGORY -->
LD>   <class name="it.unimaticaspa.unimoney.document.entity.Category"
LD>          identity="familyName category">
LD>     <map-to table="tb_cat_category" />
LD>         <field name="familyName" type="string">
LD>           <sql name="fam_family" type="char" />
LD>         </field>
LD>         <field name="category" type="string">
LD>           <sql name="cat_category" type="char" />
LD>         </field>
LD>         <field name="iter"
LD>type="it.unimaticaspa.unimoney.document.entity.Iter" >
LD>           <sql name="fam_family itr_iter"  />
LD>         </field>
LD>   </class>

Luca, 

In and of itself, your mapping and code look OK. Please post the full
stack trace that you are receiving.

Bruce
-- 
perl -e 'print unpack("u30","<0G)U8V4\@4VYY9&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to