I've 2 beans
ECatDocuments and EDocuments
I created a relationships like this
in ECatDocuments
/**
* @ejb.interface-method
*
* @ejb.relation
* name="ECatDocuments-EDocuments"
* role-name="ECatDocuments-has-many-EDocuments"
* @jboss.relation
* related-pk-field="docid"
* fk-column="docid"
in EDocuments
/**
* @ejb.interface-method
*
* @ejb.relation
* name="ECatDocuments-EDocuments"
* role-name="EDocuments-has-ECatDocuments"
* target-ejb="ECatDocuments"
*
*/
and the relationships in ejb-jar.xml is :
<ejb-relation >
<ejb-relation-name>ECatDocuments-EDocuments</ejb-relation-name>
<ejb-relationship-role >
<ejb-relationship-role-name>ECatDocuments-has-many-EDocuments</ejb-relationship-role-name>
Many
<relationship-role-source >
<ejb-name>ECatDocuments</ejb-name>
</relationship-role-source>
<cmr-field >
<cmr-field-name>documents</cmr-field-name>
</cmr-field>
</ejb-relationship-role>
<ejb-relationship-role >
<ejb-relationship-role-name>EDocuments-has-ECatDocuments</ejb-relationship-role-name>
One
<relationship-role-source >
<ejb-name>EDocuments</ejb-name>
</relationship-role-source>
<cmr-field >
<cmr-field-name>documents</cmr-field-name>
<cmr-field-type>java.util.Collection</cmr-field-type>
</cmr-field>
</ejb-relationship-role>
</ejb-relation>
everything all right but..
when I want to create a query in ECatDocuments like this :
* @ejb.finder
* query="SELECT OBJECT(b) FROM catDocumentsSchema a, IN(a.documents) b where a.catid=?1"
* signature="java.util.Collection findDocsByCatid(int catId)"
this deploy error appear:
Depends On Me: org.jboss.deployment.DeploymentException: Error compiling EJB-QL statement 'SELECT OBJECT(b) FROM catDocumentsSchema a, IN(a.documents) b where a.docid=?1'; - nested throwable: (org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "a.documents" at line 1, column 50.
Was expecting:
<COLLECTION_VALUED_PATH> ...
)]
somebody can help me??!!!
Thanks in advance!!!!