/** * 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; }
/** * Returns a ProcedureQuery. */ public Query getQuery() { ProcedureQuery query = new ProcedureQuery(); Object root = getRoot(); if (root != null) { query.setRoot(root); } query.setName(name); query.setResultEntityName(resultEntity); query.initWithProperties(properties); 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; }
@Override public ProcedureQuery buildQuery() { ProcedureQuery procedureQuery = new ProcedureQuery(); if (root != null) { procedureQuery.setRoot(root); } procedureQuery.setName(this.getName()); procedureQuery.setDataMap(dataMap); procedureQuery.setResultEntityName(this.getResultEntityName()); procedureQuery.initWithProperties(this.getProperties()); return procedureQuery; }