Declarative JDOQL vs Single-String JDOQL : performance
- by DrDro
When querying with JDOQL is there a performance difference between using the declarative version and the Single-String version:
Example from the JDOQL doc:
//Declarative JDOQL :
Query q = pm.newQuery(org.jpox.Person.class, "lastName == \"Jones\" && age < age_limit");
q.declareParameters("double age_limit");
List results = (List)q.execute(20.0);
//Single-String JDOQL :
Query q = pm.newQuery("SELECT FROM org.jpox.Person WHERE lastName == \"Jones\"" +
" && age < :age_limit PARAMETERS double age_limit");
List results = (List)q.execute(20.0);
Other then performance, are there any reasons for which one is better to use then the other or is it just about the one with which we feel more comfortable.