use of org.hibernate.query.spi.QueryParameterBinding in project hibernate-orm by hibernate.
the class QueryParameterBindingsImpl method isBound.
public boolean isBound(QueryParameter parameter) {
final QueryParameterBinding binding = locateBinding(parameter);
if (binding != null) {
return binding.getBindValue() != null;
}
final QueryParameterListBinding listBinding = locateQueryParameterListBinding(parameter);
if (listBinding != null) {
return listBinding.getBindValues() != null;
}
return false;
}
use of org.hibernate.query.spi.QueryParameterBinding in project hibernate-orm by hibernate.
the class QueryParameterBindingsImpl method transformQueryParameterBindingToQueryParameterListBinding.
/**
* @deprecated (since 5.2) expected changes to "collection-valued parameter binding" in 6.0
*/
@Deprecated
private <T> QueryParameterListBinding<T> transformQueryParameterBindingToQueryParameterListBinding(QueryParameter<T> queryParameter) {
log.debugf("Converting QueryParameterBinding to QueryParameterListBinding for given QueryParameter : %s", queryParameter);
final QueryParameterBinding binding = getAndRemoveBinding(queryParameter);
if (binding == null) {
throw new IllegalArgumentException("Could not locate QueryParameterBinding for given QueryParameter : " + queryParameter + "; parameter list must be defined using named parameter");
}
final QueryParameterListBinding<T> convertedBinding = new QueryParameterListBindingImpl<>(binding.getBindType(), shouldValidateBindingValue());
parameterListBindingMap.put(queryParameter, convertedBinding);
return convertedBinding;
}
use of org.hibernate.query.spi.QueryParameterBinding in project hibernate-orm by hibernate.
the class QueryParameterBindingsImpl method collectNamedParameterBindings.
/**
* @deprecated (since 5.2) expect a different approach to org.hibernate.engine.spi.QueryParameters in 6.0
*/
@Deprecated
public Map<String, TypedValue> collectNamedParameterBindings() {
Map<String, TypedValue> collectedBindings = new HashMap<>();
for (Map.Entry<QueryParameter, QueryParameterBinding> entry : parameterBindingMap.entrySet()) {
if (entry.getKey().getName() == null) {
continue;
}
Type bindType = entry.getValue().getBindType();
if (bindType == null) {
log.debugf("Binding for named-parameter [%s] did not define type", entry.getKey().getName());
bindType = SerializableType.INSTANCE;
}
collectedBindings.put(entry.getKey().getName(), new TypedValue(bindType, entry.getValue().getBindValue()));
}
return collectedBindings;
}
Aggregations