hibernate/hibernate-orm · error · SemanticException
Slice operator applied to expression which is not a string o
Error message
Slice operator applied to expression which is not a string or SQL array
What it means
Error "Slice operator applied to expression which is not a string or SQL array" thrown in hibernate/hibernate-orm.
Source
Thrown at hibernate-core/src/main/java/org/hibernate/query/hql/internal/SemanticQueryBuilder.java:5822
BinaryArithmeticOperator.SUBTRACT,
end,
start,
nodeBuilder()
),
new SqmLiteral<>(
1,
nodeBuilder().getIntegerType(),
nodeBuilder()
),
nodeBuilder()
)
),
null,
queryEngine()
);
}
else {
throw new SemanticException( "Slice operator applied to expression which is not a string or SQL array", query );
}
}
else {
throw new ParsingException( "Illegal domain path '" + ctx.getText() + "'" );
}
}
private SemanticPathPart visitIndexedPathAccessFragment(
SemanticPathPart pathPart,
HqlParser.IndexedPathAccessFragmentContext idxCtx) {
if ( idxCtx == null ) {
return pathPart;
}
final var indexExpression = (SqmExpression<?>) idxCtx.expression().accept(this );
final boolean hasIndexContinuation = idxCtx.DOT() != null;
final var indexedPath =
pathPart.resolveIndexedAccess( indexExpression, !hasIndexContinuation, this );View on GitHub (pinned to fad1729dce)
Solutions
- The slice operator only works on strings and SQL arrays. Apply it to a string or array expression.
When it happens
Trigger: The slice operator is applied to an unsupported expression: Slice operator applied to expression which is not a string or SQL array
Common situations: Using array/string slicing on expressions whose type is unknown or neither string nor SQL array.
AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22).
Data as JSON: /api/errors/a9bf0b3c58ae1c5f.
Report an issue: GitHub.