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
THis bug is fixed in the latest Hibernate3 CVS/dist. You'll have to wait for the next Preview release of JBoss EJB3 though. Preview 5 may go out next week.