{"record":{"id":"0f9c834fd5feb480","repo":"hibernate/hibernate-orm","slug":"parsing-of-graph-text-is-not-supported-with-moder","errorCode":null,"errorMessage":"Parsing of graph text is not supported with 'modern' graph parser mode","messagePattern":"Parsing of graph text is not supported with 'modern' graph parser mode","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/graph/internal/parse/strategy/ModernGraphParsingStrategy.java","lineNumber":40,"sourceCode":"\n\t@Override\n\tpublic <T> RootGraphImplementor<T> parse(\n\t\t\tEntityDomainType<T> entityDomainType,\n\t\t\tString graphText,\n\t\t\tSessionFactoryImplementor sessionFactory) {\n\t\tif ( graphText == null ) {\n\t\t\treturn null;\n\t\t}\n\t\tfinal var parser = new GraphLanguageParser( new CommonTokenStream( new GraphLanguageLexer(\n\t\t\t\tCharStreams.fromString( graphText ) ) ) );\n\t\tfinal var graph = parser.graph();\n\n\t\treturn parse( entityDomainType, graph.graphElementList(), sessionFactory );\n\t}\n\n\t@Override\n\tpublic <T> RootGraphImplementor<T> parse(String graphText, SessionFactoryImplementor sessionFactory) {\n\t\tthrow new UnsupportedOperationException(\n\t\t\t\t\"Parsing of graph text is not supported with 'modern' graph parser mode\" );\n\t}\n\n\t@Override\n\tpublic void parseInto(GraphImplementor<?> graph, String graphText, SessionFactoryImplementor sessionFactory) {\n\t\tfinal var parser = new GraphLanguageParser( new CommonTokenStream( new GraphLanguageLexer(\n\t\t\t\tCharStreams.fromString( graphText ) ) ) );\n\t\tfinal var graphCtx = parser.graph();\n\t\tfinal var visitor = new GraphParser( sessionFactory );\n\t\tvisitor.getGraphStack().push( graph );\n\t\ttry {\n\t\t\tvisitor.visitGraphElementList( graphCtx.graphElementList() );\n\t\t}\n\t\tfinally {\n\t\t\tvisitor.getGraphStack().pop();\n\t\t\tassert visitor.getGraphStack().isEmpty();\n\t\t}\n\t}","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/graph/internal/parse/strategy/ModernGraphParsingStrategy.java#L22-L58","documentation":"Error \"Parsing of graph text is not supported with 'modern' graph parser mode\" thrown in hibernate/hibernate-orm.","triggerScenarios":"Thrown while parsing entity graph text that does not conform to the expected format for the configured parser mode.","commonSituations":"Typical situations: including an entity name where the legacy strategy forbids it (or omitting it where required); using parse() with the modern parser mode selected.","solutions":["Build the graph programmatically with the EntityGraph API when using the modern parser mode.","Or switch the graph parser mode to legacy if textual parsing is required."],"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"}