There is a segment of my criteria query, which i hope to generate a sql segement as substring(manifest_url, instr(manifest_url, '?') - 14, 10)
final Path<String> manifestUrlPath = JpaUtils.getPath(SystemComponentTask::getManifestUrl, root);
final Expression<Integer> indexExp = cb.diff(cb.function("INSTR", Integer.class, manifestUrlPath, cb.literal("?")), 14);
cb.substring(manifestUrlPath, indexExp, cb.literal(10));
But i found that (using p6spy) generated sql removed the third parameter ‘cb.literal(10))’.
And i debugged through generating codes,
org.hibernate.query.criteria.internal.expression.function.SubstringFunction
is the class which generate this sql segement, and before generating HQLQueryPlan everthing is alright, but the generated HQLQueryPlan sqlString just removed the third paramater.
is there anything wrong during my invocation of criteria query api?