/** * Creates and returns a new ProcedureQuery built using this query as a prototype and * substituting template parameters with the values from the map. * * @since 1.1 */ public Query createQuery(Map<String, ?> parameters) { // create a query replica ProcedureQuery query = new ProcedureQuery(); if (root != null) { query.setRoot(root); } query.setResultEntityName(resultEntityName); query.metaData.copyFromInfo(this.metaData); query.setParameters(parameters); // TODO: implement algorithm for building the name based on the original name and // the hashcode of the map of parameters. This way query clone can take advantage // of caching. return query; }
/** * Creates and returns a new ProcedureQuery built using this query as a prototype and * substituting template parameters with the values from the map. * * @since 1.1 */ public Query createQuery(Map parameters) { // create a query replica ProcedureQuery query = new ProcedureQuery(); if (root != null) { query.setRoot(root); } query.setResultClassName(resultClassName); query.setResultEntityName(resultEntityName); query.metaData.copyFromInfo(this.metaData); query.setParameters(parameters); // TODO: implement algorithm for building the name based on the original name and // the hashcode of the map of parameters. This way query clone can take advantage // of caching. return query; }
procedureQuery.setParameters(params);