0 Replies Latest reply on Dec 21, 2010 1:31 AM by Eswaramoorthy S

    search

    Eswaramoorthy S Newbie
      Eg :

      select * from key_process_area where KPA_name like '%ma%';

      how can i use this on the restriction in below code.


      public class KeyProcessAreaList extends EntityQuery<KeyProcessArea> {

           private static final long serialVersionUID = 5352167199843849703L;

           private static final String EJBQL = "select keyProcessArea from KeyProcessArea keyProcessArea";

           private static final String[] RESTRICTIONS = {
                     "lower(keyProcessArea.kpaDesc) like lower(concat(#{keyProcessAreaList.keyProcessArea.kpaDesc},'%'))",
                     "lower(keyProcessArea.kpaName) like lower(concat(#{keyProcessAreaList.keyProcessArea.kpaName},'%'))",};

           private KeyProcessArea keyProcessArea = new KeyProcessArea();

           public KeyProcessAreaList() {
                setEjbql(EJBQL);
                setRestrictionExpressionStrings(Arrays.asList(RESTRICTIONS));
                setMaxResults(25);
           }

           public KeyProcessArea getKeyProcessArea() {
                return keyProcessArea;
           }
      }


      Please anybody help me.

      Thanks & Regards
      Eswaramoorthy