0 Replies Latest reply on Jan 30, 2003 3:45 PM by Mad

    Help Please! Urgent! Problem using "IN" operator in EJBQL

    Mad Newbie

      Hi,

      I have a problem...

      Two beans, this is my relation:

      <ejb-relation-name>NavigationTree-Areas</ejb-relation-name>
      <ejb-relationship-role>
      <ejb-relationship-role-name>NavigationTree</ejb-relationship-role-name>
      Many
      <cascade-delete/>
      <relationship-role-source>
      <ejb-name>NavigationTree</ejb-name>
      </relationship-role-source>
      <cmr-field>
      <cmr-field-name>areaId</cmr-field-name>
      </cmr-field>
      </ejb-relationship-role>
      <ejb-relationship-role>
      <ejb-relationship-role-name>AreaId</ejb-relationship-role-name>
      One
      <relationship-role-source>
      <ejb-name>Areas</ejb-name>
      </relationship-role-source>
      <cmr-field>
      <cmr-field-name>navigationTree</cmr-field-name>
      <cmr-field-type>java.util.Collection</cmr-field-type>
      </cmr-field>
      </ejb-relationship-role>
      </ejb-relation>

      and this is my query:


      <query-method>
      <method-name>findAllNavigationTreeByAreaAndLanguage</method-name>
      <method-params>
      <method-param>java.lang.Integer</method-param>
      <method-param>java.lang.Integer</method-param>
      </method-params>
      </query-method>
      <ejb-ql>SELECT Object(o) FROM NavigationTree AS o, IN (o.areaId) as t, IN (o.languageId) as r WHERE t.areaId = ?1 AND r.languageId = ?2</ejb-ql>


      and I get an error:

      org.jboss.deployment.DeploymentException: Error compiling ejbql; - nested throwable: (org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "o.areaId" atline 1, column 50.
      Was expecting:
      <COLLECTION_VALUED_PATH>...

      Why doesn't the query don´t work? can you help me?

      Regards.

      MAD