2 Replies Latest reply on May 1, 2007 12:41 PM by Pete Muir

    Optional Fields In Query

    Jack Rumskas Newbie

      I am pretty new to Seam and Hibernate and have a question. When using the EJB3.0 EntityManager, whats the best way to eliminate optional inputs from the query before it executes. For instance, if i have a screen with 5 input fields on it, of which any of them can be left blank and should not show up in the query where clause. Is there functionality for doing this in Seam/EJB3? or does the query have to be built by concatenation each time a call is made based on what fields are sent in from the screen?
      If there is a simple solution, a code example would be helpful if possible.
      Keep in mind that some fields are integers in the database and some are chars.