Description

Criteria.function will generate an SQL with only the last parameter casted and to the wrong type.
Expression<String> stPointFunc = cb.function(
"db2gse.st_point",
String.class,
cb.literal(0.0),
cb.literal(0.0),
cb.literal(1003));

Starts with 1 (second parameter and not the first one), whil sql.addCastForParam only works for the last ? in the sql buffer, meaning the cast for the param at index 1 is added to the last ? and the method will not do anything else.

This issue leaves Criteria.function useless to me, I tried extending my DBDictionary to remove all the cast as a work around but the function became ambiguous.