I am having some trouble in executing a simple Oql query that contains implicit joins.

Reading JDO faqs from exolab I suppose implicit joins *are* supported, but I can't make them work.


The exception is an ArrayIndexOutOfBoundsException and is thrown by the execute method, following are code and mapping.

Thank you in advance for any suggestion. I would like to thank you for providing Castor. We are introducing it in our company and it is "cleaning" our code from the sql pollution :-) !

bye, Luca Dall'Olio [EMAIL PROTECTED]



The code is :

Database db = _jdo.getDatabase();

db.begin();


// Look up the products and if found in the database,
// delete them from the database
String val="mandato_semplice";
OQLQuery catOql = db.getOQLQuery(
"SELECT p FROM
it.unimaticaspa.unimoney.document.entity.Category p WHERE p.iter.iter =
$1"); //
catOql.bind("mandato_semplice");
QueryResults results = catOql.execute();
db.commit();
db.close();




The mapping is:






<!-- ITER ITER ITER ITER ITER -->
<class name="it.unimaticaspa.unimoney.document.entity.Iter"
identity="familyName iter">
<map-to table="tb_itr_iter" />
<field name="familyName" type="string">
<sql name="fam_family" type="char" />
</field>
<field name="iter" type="string">
<sql name="itr_iter" type="char" />
</field>
<field name="types"
type="it.unimaticaspa.unidoc.document.DocumentType"
lazy="false"
collection="collection">
<sql many-table="TB_IDT_ITER_DOCUMENT_TYPE" />
</field>

<field name="categories"
type="it.unimaticaspa.unimoney.document.entity.Category"
lazy="false"
collection="collection">
<sql many-key="fam_family itr_iter" />
</field>
</class>

<!--CATEGORY CATEGORY CATEGORY -->
<class name="it.unimaticaspa.unimoney.document.entity.Category"
identity="familyName category">
<map-to table="tb_cat_category" />
<field name="familyName" type="string">
<sql name="fam_family" type="char" />
</field>
<field name="category" type="string">
<sql name="cat_category" type="char" />
</field>
<field name="iter"
type="it.unimaticaspa.unimoney.document.entity.Iter" >
<sql name="fam_family itr_iter" />
</field>
</class>

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

Reply via email to