{"record":{"id":"917f2a42cdd39602","repo":"hibernate/hibernate-orm","slug":"cockroachdb-json-value-only-support-literal-json-p","errorCode":null,"errorMessage":"CockroachDB json_value only support literal json paths, but got \" + arguments.jsonPath()","messagePattern":"CockroachDB json_value only support literal json paths, but got \" \\+ arguments\\.jsonPath\\(\\)","errorType":"exception","errorClass":"QueryException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/dialect/function/json/CockroachDBJsonExistsFunction.java","lineNumber":45,"sourceCode":"\t\tsuper( typeConfiguration, true, true );\n\t}\n\n\t@Override\n\tprotected void render(\n\t\t\tSqlAppender sqlAppender,\n\t\t\tJsonExistsArguments arguments,\n\t\t\tReturnableType<?> returnType,\n\t\t\tSqlAstTranslator<?> walker) {\n\t\t// jsonb_path_exists errors by default\n\t\tif ( arguments.errorBehavior() != null && arguments.errorBehavior() != JsonExistsErrorBehavior.ERROR ) {\n\t\t\tthrow new QueryException( \"Can't emulate on error clause on CockroachDB\" );\n\t\t}\n\t\tfinal String jsonPath;\n\t\ttry {\n\t\t\tjsonPath = walker.getLiteralValue( arguments.jsonPath() );\n\t\t}\n\t\tcatch (Exception ex) {\n\t\t\tthrow new QueryException( \"CockroachDB json_value only support literal json paths, but got \" + arguments.jsonPath() );\n\t\t}\n\t\tappendJsonExists(\n\t\t\t\tsqlAppender,\n\t\t\t\targuments.jsonDocument(),\n\t\t\t\tJsonPathHelper.parseJsonPathElements( jsonPath ),\n\t\t\t\targuments.isJsonType(),\n\t\t\t\targuments.passingClause(),\n\t\t\t\twalker\n\t\t);\n\t}\n\n\tstatic void appendJsonExists(\n\t\t\tSqlAppender sqlAppender,\n\t\t\tExpression jsonDocument,\n\t\t\tList<JsonPathHelper.JsonPathElement> jsonPathElements,\n\t\t\tboolean isJsonType,\n\t\t\t@Nullable JsonPathPassingClause jsonPathPassingClause,\n\t\t\tSqlAstTranslator<?> walker) {","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/dialect/function/json/CockroachDBJsonExistsFunction.java#L27-L63","documentation":"Error \"CockroachDB json_value only support literal json paths, but got \" + arguments.jsonPath()\" thrown in hibernate/hibernate-orm.","triggerScenarios":"Triggered when the application calls a Hibernate dialect feature that the configured database dialect cannot provide: CockroachDB json_value only support literal json paths.","commonSituations":"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: CockroachDB json_value only support literal json paths.","solutions":["Pass the JSON path as a string literal.","Inline the path instead of using a parameter."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}