{"record":{"id":"34b4705184bb94a6","repo":"hibernate/hibernate-orm","slug":"class-componentclassname-is-the-idclass-for","errorCode":null,"errorMessage":"Class '<componentClassName>' is the '@IdClass' for the entity '<entityName>' but has no persistent properties","messagePattern":"Class '<componentClassName>' is the '@IdClass' for the entity '<entityName>' but has no persistent properties","errorType":"exception","errorClass":"AnnotationException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/boot/model/internal/EntityBinder.java","lineNumber":810,"sourceCode":"\t\t\t\tfalse,\n\t\t\t\tthis,\n\t\t\t\ttrue,\n\t\t\t\tfalse,\n\t\t\t\tfalse,\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\tbuildingContext,\n\t\t\t\tinheritanceStates,\n\t\t\t\ttrue\n\t\t);\n\t\tid.setKey( true );\n\t\tif ( rootClass.getIdentifier() != null ) {\n\t\t\tthrow new AssertionFailure( \"Entity '\" + persistentClass.getEntityName()\n\t\t\t\t\t+ \"' has an '@IdClass' and may not have an identifier property\" );\n\t\t}\n\t\tif ( id.getPropertySpan() == 0 ) {\n\t\t\tthrow new AnnotationException( \"Class '\" + id.getComponentClassName()\n\t\t\t\t\t+ \" is the '@IdClass' for the entity '\" + persistentClass.getEntityName()\n\t\t\t\t\t+ \"' but has no persistent properties\" );\n\t\t}\n\n\t\trootClass.setIdentifier( id );\n\t\trootClass.setEmbeddedIdentifier( inferredData.getPropertyType() == null );\n\t\tpropertyHolder.setInIdClass( null );\n\t\treturn id;\n\t}\n\n\tprivate void handleSecondaryTables() {\n\t\tannotatedClass.forEachRepeatedAnnotationUsages( JpaAnnotations.SECONDARY_TABLE, modelsContext(),\n\t\t\t\tusage -> addSecondaryTable( usage, null, false ) );\n\t}\n\n\tprivate void handleClassTable(InheritanceState inheritanceState, PersistentClass superEntity) {\n\t\tfinal String schema;\n\t\tfinal String table;","sourceCodeStart":792,"sourceCodeEnd":828,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/boot/model/internal/EntityBinder.java#L792-L828","documentation":"Error \"Class '<componentClassName>' is the '@IdClass' for the entity '<entityName>' but has no persistent properties\" thrown in hibernate/hibernate-orm.","triggerScenarios":"A composite identifier mapping (@IdClass/@EmbeddedId/@MapsId) does not match the entity's persistent properties.","commonSituations":"Composite primary keys where the id class properties, their types, or @MapsId values drift out of sync with the entity, or an embeddable with inheritance is reused as an id.","solutions":["Add persistent properties to the @IdClass matching the entity identifier properties."],"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"}