{"record":{"id":"3424cf82467129b9","repo":"hibernate/hibernate-orm","slug":"expecting-graph-text-to-not-include-an-entity-name-3424cf","errorCode":null,"errorMessage":"Expecting graph text to not include an entity name : {}","messagePattern":"Expecting graph text to not include an entity name : (.+?)","errorType":"exception","errorClass":"InvalidGraphException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/graph/internal/parse/strategy/LegacyGraphParsingStrategy.java","lineNumber":33,"sourceCode":"import org.hibernate.graph.internal.parse.LegacyGraphParser;\nimport org.hibernate.graph.spi.GraphImplementor;\nimport org.hibernate.graph.spi.GraphParserEntityNameResolver;\nimport org.hibernate.graph.spi.RootGraphImplementor;\nimport org.hibernate.metamodel.model.domain.EntityDomainType;\n\n@Deprecated(forRemoval = true)\npublic class LegacyGraphParsingStrategy implements GraphParsingStrategy {\n\n\t@Override\n\tpublic <T> RootGraphImplementor<T> parse(EntityDomainType<T> entityDomainType, String graphText, SessionFactoryImplementor sessionFactory) {\n\t\tif ( graphText == null ) {\n\t\t\treturn null;\n\t\t}\n\t\tfinal var parser = new LegacyGraphLanguageParser(\n\t\t\t\tnew CommonTokenStream( new GraphLanguageLexer( CharStreams.fromString( graphText ) ) ) );\n\t\tfinal var graph = parser.graph();\n\t\tif ( graph.typeIndicator() != null ) {\n\t\t\tthrow new InvalidGraphException( \"Expecting graph text to not include an entity name : \" + graphText );\n\t\t}\n\t\treturn parse( entityDomainType, graph.attributeList(), sessionFactory );\n\t}\n\n\t@Override\n\t@Deprecated(forRemoval = true)\n\tpublic <T> RootGraphImplementor<T> parse(String graphText, SessionFactoryImplementor sessionFactory) {\n\t\tif ( graphText == null ) {\n\t\t\treturn null;\n\t\t}\n\t\tfinal var parser = new LegacyGraphLanguageParser(\n\t\t\t\tnew CommonTokenStream( new GraphLanguageLexer( CharStreams.fromString( graphText ) ) ) );\n\t\tfinal var graph = parser.graph();\n\t\tif ( graph.typeIndicator() == null ) {\n\t\t\tthrow new InvalidGraphException( \"Expecting graph text to include an entity name : \" + graphText );\n\t\t}\n\t\tfinal String entityName = graph.typeIndicator().TYPE_NAME().getText();\n\t\t@SuppressWarnings(","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/graph/internal/parse/strategy/LegacyGraphParsingStrategy.java#L15-L51","documentation":"Error \"Expecting graph text to not include an entity name : {}\" 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":["Remove the entity name prefix from the graph text when the parsing strategy does not expect it.","Pass the graph text in the legacy format expected by the configured parser mode."],"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"}