4 Replies Latest reply on Sep 10, 2009 10:51 PM by David Jitendranath

    problem with EL restrictions for simple query

    David Jitendranath Novice

      can someone please tell me how I can get the restrictions to work for this simple query?
      The below code does not work.  It ignores the restriction.
      I also tried the EL with the oracleUserName within quotes that treats the parameter as a literal.



              private static final String EJBQL = "select employee from Employee employee";
      
           public Employee getEmployee(String oracleUserName){
                employee = new Employee();
                employee.setId(new EmployeeId());
                setEjbql(EJBQL);
                String[] EMPBYUSERNAME_RESTRICTIONS = {
                          "lower(employee.oracleUsername) = #{oracleUserName}",};
                setRestrictionExpressionStrings(Arrays.asList(EMPBYUSERNAME_RESTRICTIONS));
                employee = getSingleResult();
                return employee;
           }