1 Reply Latest reply on Sep 13, 2004 2:26 AM by Gerd Streubel

    Finder-Method for a 1:1 relation - IN operator doesn't work

    saschav Newbie

      Hi All.

      I want to write a finder that finds the parent objetc for a 1:1 relation. Wirth a 1:many relation, i can use the IN operator, but with a 1:1, I got no idea what to do.
      My EntityBeans look like this:

      TempData:
      uuid: String
      name: String
      binaryData: BinaryData
      tumbnailImage: BinaryData
      previewImage: BinaryData
      [...]

      BinaryData:
      uuid: String
      name: String
      [...]

      When I try using a statement like
      @ejb.finder
      signature = "TempDatenLocal findTempDataByBinaryData(java.lang.String binaryDataId)"
      query="
      SELECT OBJECT(a)
      FROM TempData AS a, IN(a.binaryData) AS b
      WHERE (b.uuid = ?1)
      "

      I get this:

      org.jboss.deployment.DeploymentException: Error compiling EJB-QL statement 'SELECT OBJECT(a) FROM TempData as a, in(a.binaryD
      ata) as b WHERE (a.uuid = ?1)'; - nested throwable: (org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "a.binaryData" at line 1, column 44.
      Was expecting:
      <COLLECTION_VALUED_PATH> ...
      )


      Any Idea, how I can make this finder work???

      Thanks in advance,
      Sascha.