0 Replies Latest reply on Jan 17, 2008 8:08 PM by Tomas Cerny

    Search with  EntityQuery and OR operator

    Tomas Cerny Novice

      I am sure that a lot of you need sometimes the same think as me. I have a simple search that applies one input to more search parameters. But I did not find any nice way to change 'AND'ed criteria to 'OR'ed.

      As I was hacking it, I did this:

      
      ...
      public class SimplePersonList extends EntityQuery {
      ....
      protected String getRenderedEjbql() {
       String ejbql = super.getRenderedEjbql();
       return ejbql.replaceAll(" and ", " or ");
      }
      ....
      


      Tada thats it and works.
      ---
      Do you have a better way to do this? I consider my version as a little hack and expect that Seam also expects requirements as I need.