This content has been marked as final.
Show 4 replies
-
1. Re: problem with EL restrictions for simple query
pdhaigh Sep 4, 2009 2:46 PM (in response to davestar)Where do you set oracleUserName to an EL-accessible component?
I think you might find that it ignores the restriction because
#{oracleUserName}
is resolving to null?
-
2. Re: problem with EL restrictions for simple query
davestar Sep 9, 2009 11:13 PM (in response to davestar)The oracleUserName is not null. It is set by the code that calls the method getEmployee.
EmployeeRoleList empList = (EmployeeRoleList)Component.getInstance("employeeRoleList"); Employee employee = empList.getEmployee("sdwarf");
-
3. Re: problem with EL restrictions for simple query
psteininger Sep 10, 2009 4:52 PM (in response to davestar)David,
If you make a reference to #{oracleUsername} Seam will try to locate a component called oracleUsername.
What will likely work in your case is something like:String[] EMPBYUSERNAME_RESTRICTIONS = {"lower(employee.oracleUsername) = " + oracleUserName};
you may need yo add single quotes around the value.
-
4. Re: problem with EL restrictions for simple query
davestar Sep 10, 2009 10:51 PM (in response to davestar)When I tried
String[] EMPBYUSERNAME_RESTRICTIONS = {"lower(employee.oracleUsername) = " + oracleUserName};
I get a
javax.el.ELException: java.lang.IllegalArgumentException: there should be exactly one value binding in a restriction: org.jboss.seam.core.Expressions$1@16ec82When I add single quotes around the value, the restriction is ignored.
Being able to add string variables to an expression would be really helpful, not sure if it's a seam limitation for now??