4 Replies Latest reply on Jan 16, 2003 11:34 AM by Markus

    EJB-QL: LOCATE problem

    Markus Newbie


      because of the LIKE problem in EJB-QL I've used the following finder code for my CMP2.0 bean (using Xdoclet):

      * @ejb:finder signature="java.util.Collection findByTitleFrag( java.lang.String pTitle )"
      * query="SELECT OBJECT(o) FROM Item AS o WHERE LOCATE(o.title, ?1) >= 0"
      * @jboss:finder-query name="findByTitleFrag"
      * query="UPPER(I_TITLE) LIKE UPPER('%{0}%')"

      But this doesn't work! It always returns every bean! If I use '> 0' instead of '>= 0' it doesn't return any bean, but there exist some....

      Thanks for your help,