/** * Gets the parameter keys bound with this query. Parameter key can be Integer, String or a ParameterExpression * itself but all parameters keys of a particular query are of the same type. */ public Set<?> getBoundParameterKeys() { if (_boundParams == null) return Collections.EMPTY_SET; getDeclaredParameters(); Set<Object> result = new HashSet<Object>(); for (Map.Entry<Object, Parameter<?>> entry : _declaredParams.entrySet()) { if (isBound(entry.getValue())) { result.add(entry.getKey()); } } return result; }
/** * Gets the parameter keys bound with this query. Parameter key can be Integer, String or a ParameterExpression * itself but all parameters keys of a particular query are of the same type. */ public Set<?> getBoundParameterKeys() { if (_boundParams == null) return Collections.EMPTY_SET; getDeclaredParameters(); Set<Object> result = new HashSet<Object>(); for (Map.Entry<Object, Parameter<?>> entry : _declaredParams.entrySet()) { if (isBound(entry.getValue())) { result.add(entry.getKey()); } } return result; }
/** * Gets the parameter keys bound with this query. Parameter key can be Integer, String or a ParameterExpression * itself but all parameters keys of a particular query are of the same type. */ public Set<?> getBoundParameterKeys() { if (_boundParams == null) return Collections.EMPTY_SET; getDeclaredParameters(); Set<Object> result = new HashSet<Object>(); for (Map.Entry<Object, Parameter<?>> entry : _declaredParams.entrySet()) { if (isBound(entry.getValue())) { result.add(entry.getKey()); } } return result; }
/** * Gets the parameter keys bound with this query. Parameter key can be Integer, String or a ParameterExpression * itself but all parameters keys of a particular query are of the same type. */ public Set<?> getBoundParameterKeys() { if (_boundParams == null) return Collections.EMPTY_SET; getDeclaredParameters(); Set<Object> result = new HashSet<Object>(); for (Map.Entry<Object, Parameter<?>> entry : _declaredParams.entrySet()) { if (isBound(entry.getValue())) { result.add(entry.getKey()); } } return result; }
void assertBound(Parameter<?> param) { if (!isBound(param)) { throw new IllegalStateException(_loc.get("param-not-bound", param, getQueryString(), getBoundParameterKeys()).getMessage()); } }
void assertBound(Parameter<?> param) { if (!isBound(param)) { throw new IllegalStateException(_loc.get("param-not-bound", param, getQueryString(), getBoundParameterKeys()).getMessage()); } }
void assertBound(Parameter<?> param) { if (!isBound(param)) { throw new IllegalStateException(_loc.get("param-not-bound", param, getQueryString(), getBoundParameterKeys()).getMessage()); } }
void assertBound(Parameter<?> param) { if (!isBound(param)) { throw new IllegalStateException(_loc.get("param-not-bound", param, getQueryString(), getBoundParameterKeys()).getMessage()); } }
/** * Return the value bound to the parameter. * * @param param * parameter object * @return parameter value * @throws IllegalStateException * if the parameter has not been been bound * @throws IllegalArgumentException * if the parameter does not belong to this query */ public <T> T getParameterValue(Parameter<T> p) { if (!isBound(p)) { throw new IllegalArgumentException(_loc.get("param-missing", p, getQueryString(), getBoundParameterKeys()) .getMessage()); } return (T) _boundParams.get(p); }
/** * Return the value bound to the parameter. * * @param param * parameter object * @return parameter value * @throws IllegalStateException * if the parameter has not been been bound * @throws IllegalArgumentException * if the parameter does not belong to this query */ public <T> T getParameterValue(Parameter<T> p) { if (!isBound(p)) { throw new IllegalArgumentException(_loc.get("param-missing", p, getQueryString(), getBoundParameterKeys()) .getMessage()); } return (T) _boundParams.get(p); }
/** * Return the value bound to the parameter. * * @param param * parameter object * @return parameter value * @throws IllegalStateException * if the parameter has not been been bound * @throws IllegalArgumentException * if the parameter does not belong to this query */ public <T> T getParameterValue(Parameter<T> p) { if (!isBound(p)) { throw new IllegalArgumentException(_loc.get("param-missing", p, getQueryString(), getBoundParameterKeys()) .getMessage()); } return (T) _boundParams.get(p); }
/** * Return the value bound to the parameter. * * @param param * parameter object * @return parameter value * @throws IllegalStateException * if the parameter has not been been bound * @throws IllegalArgumentException * if the parameter does not belong to this query */ public <T> T getParameterValue(Parameter<T> p) { if (!isBound(p)) { throw new IllegalArgumentException(_loc.get("param-missing", p, getQueryString(), getBoundParameterKeys()) .getMessage()); } return (T) _boundParams.get(p); }
/** * Gets the value of all the named parameters. * * If a parameter has been declared but not bound to a value then the value is null and hence is indistinguishable * from the value being actually null. */ public Map<String, Object> getNamedParameters() { lock(); try { Map<String, Object> result = new HashMap<String, Object>(); Set<String> namedKeys = getDeclaredParameterKeys(String.class); for (String name : namedKeys) { Parameter<?> param = getParameter(name); result.put(name, isBound(param) ? getParameterValue(name) : null); } return result; } finally { unlock(); } }
/** * Gets the value of all the named parameters. * * If a parameter has been declared but not bound to a value then the value is null and hence is indistinguishable * from the value being actually null. */ public Map<String, Object> getNamedParameters() { lock(); try { Map<String, Object> result = new HashMap<String, Object>(); Set<String> namedKeys = getDeclaredParameterKeys(String.class); for (String name : namedKeys) { Parameter<?> param = getParameter(name); result.put(name, isBound(param) ? getParameterValue(name) : null); } return result; } finally { unlock(); } }
/** * Gets the value of all the named parameters. * * If a parameter has been declared but not bound to a value then the value is null and hence is indistinguishable * from the value being actually null. */ public Map<String, Object> getNamedParameters() { lock(); try { Map<String, Object> result = new HashMap<String, Object>(); Set<String> namedKeys = getDeclaredParameterKeys(String.class); for (String name : namedKeys) { Parameter<?> param = getParameter(name); result.put(name, isBound(param) ? getParameterValue(name) : null); } return result; } finally { unlock(); } }
/** * Gets the value of all the named parameters. * * If a parameter has been declared but not bound to a value then the value is null and hence is indistinguishable * from the value being actually null. */ public Map<String, Object> getNamedParameters() { lock(); try { Map<String, Object> result = new HashMap<String, Object>(); Set<String> namedKeys = getDeclaredParameterKeys(String.class); for (String name : namedKeys) { Parameter<?> param = getParameter(name); result.put(name, isBound(param) ? getParameterValue(name) : null); } return result; } finally { unlock(); } }
/** * Gets the array of positional parameter values. The n-th array element represents (n+1)-th positional parameter. * If a parameter has been declared but not bound to a value then the value is null and hence is indistinguishable * from the value being actually null. If the parameter indexing is not contiguous then the unspecified parameters * are considered as null. */ public Object[] getPositionalParameters() { lock(); try { Set<Integer> positionalKeys = getDeclaredParameterKeys(Integer.class); Object[] result = new Object[calculateMaxKey(positionalKeys)]; for (Integer pos : positionalKeys) { Parameter<?> param = getParameter(pos); result[pos.intValue() - 1] = isBound(param) ? getParameterValue(pos) : null; } return result; } finally { unlock(); } }
/** * Gets the array of positional parameter values. The n-th array element represents (n+1)-th positional parameter. * If a parameter has been declared but not bound to a value then the value is null and hence is indistinguishable * from the value being actually null. If the parameter indexing is not contiguous then the unspecified parameters * are considered as null. */ public Object[] getPositionalParameters() { lock(); try { Set<Integer> positionalKeys = getDeclaredParameterKeys(Integer.class); Object[] result = new Object[calculateMaxKey(positionalKeys)]; for (Integer pos : positionalKeys) { Parameter<?> param = getParameter(pos); result[pos.intValue() - 1] = isBound(param) ? getParameterValue(pos) : null; } return result; } finally { unlock(); } }
/** * Gets the array of positional parameter values. The n-th array element represents (n+1)-th positional parameter. * If a parameter has been declared but not bound to a value then the value is null and hence is indistinguishable * from the value being actually null. If the parameter indexing is not contiguous then the unspecified parameters * are considered as null. */ public Object[] getPositionalParameters() { lock(); try { Set<Integer> positionalKeys = getDeclaredParameterKeys(Integer.class); Object[] result = new Object[calculateMaxKey(positionalKeys)]; for (Integer pos : positionalKeys) { Parameter<?> param = getParameter(pos); result[pos.intValue() - 1] = isBound(param) ? getParameterValue(pos) : null; } return result; } finally { unlock(); } }
/** * Gets the array of positional parameter values. The n-th array element represents (n+1)-th positional parameter. * If a parameter has been declared but not bound to a value then the value is null and hence is indistinguishable * from the value being actually null. If the parameter indexing is not contiguous then the unspecified parameters * are considered as null. */ public Object[] getPositionalParameters() { lock(); try { Set<Integer> positionalKeys = getDeclaredParameterKeys(Integer.class); Object[] result = new Object[calculateMaxKey(positionalKeys)]; for (Integer pos : positionalKeys) { Parameter<?> param = getParameter(pos); result[pos.intValue() - 1] = isBound(param) ? getParameterValue(pos) : null; } return result; } finally { unlock(); } }