Hi Greg, You can't make run time check or can't make use of EQL functions to evaluate EJB QL parameters i.e. parameters those are passed to finder methods as arguments. Actually it does not make sence coz objective of EQL is to reterive the data from database as per EQL , not to perform any type of check on finder method's parametrs. These check should me performed perior to calling the finder method. So method which is calling that finder method has to make this check. SO you need to create to finders
1. SELECT OBJECT(o) from MyTable WHERE o.myField = ?1
2. SELECT OBJECT(o) from MyTable WHERE o.myField IS NULL
call finder 1 when the passed parameter is not null otherwise call finder 2
Thanks Sunil. It makes some sense, but in my case myField is a unique key, which could be null or an integer. It would be nice to be able to retrieve the record with that unique key in a single query. If it's not possible though, then it's not possible.