{"record":{"id":"b94aab0e9f212d86","repo":"hibernate/hibernate-orm","slug":"at-and-token","errorCode":null,"errorMessage":"At {}:{} and token '{}', {}","messagePattern":"At (.+?):(.+?) and token '(.+?)', (.+?)","errorType":"exception","errorClass":"SyntaxException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/metamodel/mapping/ordering/OrderByFragmentTranslator.java","lineNumber":93,"sourceCode":"\t\tcatch (ParseCancellationException e) {\n\t\t\t// When resetting the parser, its CommonTokenStream will seek(0) i.e. restart emitting buffered tokens.\n\t\t\t// This is enough when reusing the lexer and parser, and it would be wrong to also reset the lexer.\n\t\t\t// Resetting the lexer causes it to hand out tokens again from the start, which will then append to the\n\t\t\t// CommonTokenStream and cause a wrong parse\n\t\t\t// lexer.reset();\n\n\t\t\t// reset the input token stream and parser state\n\t\t\tparser.reset();\n\n\t\t\t// fall back to LL(k)-based parsing\n\t\t\tparser.getInterpreter().setPredictionMode( PredictionMode.LL );\n//\t\t\tparser.addErrorListener( ConsoleErrorListener.INSTANCE );\n\t\t\tparser.setErrorHandler( new DefaultErrorStrategy() );\n\n\t\t\tfinal ANTLRErrorListener errorListener = new BaseErrorListener() {\n\t\t\t\t@Override\n\t\t\t\tpublic void syntaxError(Recognizer<?, ?> recognizer, Object offendingSymbol, int line, int charPositionInLine, String msg, RecognitionException e) {\n\t\t\t\t\tthrow new SyntaxException( prettifyAntlrError( offendingSymbol, line, charPositionInLine, msg, e, fragment, true ), fragment );\n\t\t\t\t}\n\t\t\t};\n\t\t\tparser.addErrorListener( errorListener );\n\n\t\t\treturn parser.orderByFragment();\n\t\t}\n\t\tcatch ( ParsingException ex ) {\n\t\t\t// Note that this is supposed to represent a bug in the parser\n\t\t\tthrow new QueryException( \"Failed to interpret syntax [\" + ex.getMessage() + \"]\", fragment, ex );\n\t\t}\n\t}\n\n}\n","sourceCodeStart":75,"sourceCodeEnd":107,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/ordering/OrderByFragmentTranslator.java#L75-L107","documentation":"Error \"At {}:{} and token '{}', {}\" thrown in hibernate/hibernate-orm.","triggerScenarios":"Thrown when parsing an @OrderBy fragment fails at the reported line/column and token, e.g. due to a syntax error in the ordering expression.","commonSituations":"See trigger scenarios.","solutions":["Fix the @OrderBy fragment syntax: use valid domain-model paths, '.' navigation, and optional ASC/DESC.","Check the token reported in the message against the allowed ordering grammar."],"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"}