hibernate/hibernate-orm · error · QueryException
Sybase ASE only supports passing an XPath literal to xmltabl
Error message
Sybase ASE only supports passing an XPath literal to xmltable() when using query columns, but got: ${arguments.xpath()} What it means
Error "Sybase ASE only supports passing an XPath literal to xmltable() when using query columns, but got: ${arguments.xpath()}" thrown in hibernate/hibernate-orm.
Source
Thrown at hibernate-core/src/main/java/org/hibernate/dialect/function/xml/SybaseASEXmlTableFunction.java:146
// Sybase ASE can't extract XML nodes via xmltable, so we select the ordinality instead and extract
// the XML nodes via xmlextract in select item. Unfortunately, this limits XPaths to literals
// and documents to columns or literals, since that is the only form that can be encoded in read expressions
final String documentFragment;
if ( arguments.xmlDocument() instanceof Literal documentLiteral ) {
documentFragment = documentLiteral.getJdbcMapping().getJdbcLiteralFormatter().toJdbcLiteral(
documentLiteral.getLiteralValue(),
converter.getCreationContext().getDialect(),
converter.getCreationContext().getWrapperOptions()
);
}
else if ( arguments.xmlDocument() instanceof ColumnReference columnReference ) {
documentFragment = columnReference.getExpressionText();
}
else {
throw new QueryException( "Sybase ASE only supports passing a literal or column reference as XML document for xmltable() when using query columns, but got: " + arguments.xmlDocument() );
}
if ( !( arguments.xpath() instanceof Literal literal)) {
throw new QueryException( "Sybase ASE only supports passing an XPath literal to xmltable() when using query columns, but got: " + arguments.xpath() );
}
final String xpathString = (String) literal.getLiteralValue();
final String definitionPath = definition.xpath() == null ? definition.name() : definition.xpath();
selectableMappings.add( new SelectableMappingImpl(
"",
definition.name(),
new SelectablePath( definition.name() ),
"xmlextract('" + xpathString + "['||cast(" + Template.TEMPLATE + "." + definition.name() + " as varchar)||']/" + definitionPath + "'," + documentFragment + ")",
null,
null,
null,
null,
null,
null,
false,
false,
false,View on GitHub (pinned to fad1729dce)
Solutions
- Pass the XPath as a string literal.
When it happens
Trigger: Triggered when the application calls a Hibernate dialect feature that the configured database dialect cannot provide: Sybase ASE only supports passing an XPath literal to xmltable() when using query columns.
Common situations: Common when running against a database whose dialect lacks this capability, when a mapping or HQL/Criteria query requests unsupported functionality, or when the wrong dialect is configured for the database in use. Error: Sybase ASE only supports passing an XPath literal to xmltable() when using query columns.
AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22).
Data as JSON: /api/errors/014b57f10ee806fa.
Report an issue: GitHub.