if ( params == null ) { params = new Parameters(); }
    public IObject findByQuery(@NotNull String queryName, Parameters params)     throws ValidationException    {                // specify that we should only return a single value if possible        params.getFilter().unique();                Query<IObject> q = queryFactory.lookup( queryName, params );        IObject result = null;        try {             result = execute(q);        } catch (ClassCastException cce) {            throw new ApiUsageException(                    "Query named:\n\t"+queryName+"\n" +                    "has returned an Object of type "+cce.getMessage()+"\n" +                    "Queries must return IObjects when using findByQuery. \n" +                    "Please try findAllByQuery for queries which return Lists."                    );        } catch (NonUniqueResultException nure) {            throw new ApiUsageException(                    "Query named:\n\t"+queryName+"\n" +                    "has returned more than one Object\n" +                    "findByQuery must return a single value.\n" +                    "Please try findAllByQuery for queries which return Lists."                    );        }        return result;            }