1 Reply Latest reply on Mar 25, 2005 12:12 PM by Bill Burke

    Can EJB QL Handle an "OR" within Parentheses?

    Mike Duffy Novice

      RETRIEVE_SAVED_SEARCHES_BY_USER_ID_AND_SEARCH_TITLE
      = "FROM SavedSearch s "
      + " WHERE (s.userId = :userId
      OR s.userId = " + Constants.USER_ALL_USERS + ") "
      + " AND s.searchTitle = :searchTitle";

      If the userId is in the table, but the searchTitle is not in the table, the query above should return null; however, it does not. It is as if the "OR" is being applied to everything after the "OR" and not just considering what is in the parentheses.

      Possible bug?

      Mike