{"record":{"id":"59748fe5c8a73c1c","repo":"hibernate/hibernate-orm","slug":"expecting-graph-text-to-not-include-an-entity-name","errorCode":null,"errorMessage":"Expecting graph text to not include an entity name : ${graph}","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/boot/model/internal/NamedGraphCreatorParsed.java","lineNumber":110,"sourceCode":"\t\treturn GraphParsing.visit( graphName, entityDomainType, graphContext.graphElementList(),\n\t\t\t\tentityName -> resolve( entityName, entityDomainNameResolver ) );\n\t}\n\n\n\tprivate <T> RootGraphImplementor<T> parseGraphForLegacyParsingMode(\n\t\t\tGraphParserEntityClassResolver entityDomainClassResolver,\n\t\t\tGraphParserEntityNameResolver entityDomainNameResolver) {\n\n\t\tfinal var graphContext = parseLegacyGraphText( annotation.graph() );\n\n\n\t\tEntityDomainType<T> entityDomainType;\n\n\t\tfinal var typeIndicator = graphContext.typeIndicator();\n\n\t\tif ( typeIndicator != null ) {\n\t\t\tif ( entityType != null ) {\n\t\t\t\tthrow new InvalidGraphException(\n\t\t\t\t\t\t\"Expecting graph text to not include an entity name : \" + annotation.graph() );\n\t\t\t}\n\n\t\t\tDeprecationLogger.DEPRECATION_LOGGER.deprecatedNamedEntityGraphTextThatContainTypeIndicator();\n\n\t\t\tentityDomainType = (EntityDomainType<T>) resolve( typeIndicator.TYPE_NAME().toString(), entityDomainNameResolver );\n\t\t}\n\t\telse {\n\t\t\tentityDomainType = resolveEntityDomainTypeFromAnnotation( entityDomainClassResolver );\n\t\t}\n\n\n\t\tfinal String graphName = this.name == null ? entityDomainType.getName() : this.name;\n\n\t\treturn GraphParsing.visit( graphName, entityDomainType, graphContext.attributeList(),\n\t\t\t\tentityName -> resolve( entityName, entityDomainNameResolver ) );\n\t}\n","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/boot/model/internal/NamedGraphCreatorParsed.java#L92-L128","documentation":"Error \"Expecting graph text to not include an entity name : ${graph}\" thrown in hibernate/hibernate-orm.","triggerScenarios":"Two managed types are registered under the same entity name.","commonSituations":"Duplicate @Entity(name=...) values or two classes with the same simple name in one persistence unit.","solutions":["Remove the entity name prefix from the graph text; provide it via the root parameter instead."],"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"}