use of com.haulmont.cuba.core.sys.persistence.DbmsFeatures in project cuba by cuba-platform.
the class QueryImpl method setParameter.
@Override
public TypedQuery<T> setParameter(int position, Object value, boolean implicitConversions) {
checkState();
DbmsFeatures dbmsFeatures = DbmsSpecificFactory.getDbmsFeatures();
if (isNative && (value instanceof UUID) && (dbmsFeatures.getUuidTypeClassName() != null)) {
Class c = ReflectionHelper.getClass(dbmsFeatures.getUuidTypeClassName());
try {
value = ReflectionHelper.newInstance(c, value);
} catch (NoSuchMethodException e) {
throw new RuntimeException("Error setting parameter value", e);
}
} else if (value instanceof IdProxy) {
value = ((IdProxy) value).get();
} else if (implicitConversions) {
value = handleImplicitConversions(value);
}
params.add(new Param(position, value));
return this;
}
Aggregations