{"record":{"id":"883c7b7ed478f347","repo":"hibernate/hibernate-orm","slug":"property-name-is-inherited-from-entity-entit","errorCode":null,"errorMessage":"Property '<name>' is inherited from entity '<entityName>' and may not be overridden using '@<overrideAnnotation>' in entity subclass '<className>'","messagePattern":"Property '<name>' is inherited from entity '<entityName>' and may not be overridden using '@<overrideAnnotation>' in entity subclass '<className>'","errorType":"exception","errorClass":"AnnotationException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/boot/model/internal/EntityBinder.java","lineNumber":318,"sourceCode":"\t\t\t\t\tsuperEntity,\n\t\t\t\t\tusage.name(),\n\t\t\t\t\tclazzToProcess,\n\t\t\t\t\tAttributeOverride.class\n\t\t\t) );\n\t\t}\n\t}\n\n\t/**\n\t * The rule is that an entity can override a field declared by a @MappedSuperclass\n\t * if there is no intervening entity which also inherits the field. A wrinkle is\n\t * that a mapped superclass can occur in between the root class and a subclass of\n\t * an entity hierarchy, and then the subclass can override fields declared by the\n\t * mapped superclass even though it cannot override any fields of the root class.\n\t */\n\tprivate static void checkOverride(\n\t\t\tPersistentClass superEntity, String name, ClassDetails clazzToProcess, Class<?> overrideClass) {\n\t\tif ( superEntity.hasProperty( root(name) ) ) {\n\t\t\tthrow new AnnotationException(\"Property '\" + name\n\t\t\t\t\t+ \"' is inherited from entity '\" + superEntity.getEntityName()\n\t\t\t\t\t+ \"' and may not be overridden using '@\" + overrideClass.getSimpleName()\n\t\t\t\t\t+ \"' in entity subclass '\" + clazzToProcess.getName() + \"'\");\n\t\t}\n\t}\n\n\tprivate static void bindSoftDelete(\n\t\t\tClassDetails classDetails,\n\t\t\tRootClass rootClass,\n\t\t\tMetadataBuildingContext context) {\n\t\t// todo (soft-delete) : do we assume all package-level registrations are already available?\n\t\t//\t\tor should this be a \"second pass\"?\n\n\t\tfinal var softDelete = extract( SoftDelete.class, classDetails, context );\n\t\tif ( softDelete != null ) {\n\t\t\tSoftDeleteHelper.bindSoftDeleteIndicator(\n\t\t\t\t\tsoftDelete,\n\t\t\t\t\trootClass,","sourceCodeStart":300,"sourceCodeEnd":336,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/boot/model/internal/EntityBinder.java#L300-L336","documentation":"Error \"Property '<name>' is inherited from entity '<entityName>' and may not be overridden using '@<overrideAnnotation>' in entity subclass '<className>'\" thrown in hibernate/hibernate-orm.","triggerScenarios":"An annotation restricted to the root of an inheritance hierarchy is placed on a subclass (or the hierarchy rules are otherwise violated).","commonSituations":"SINGLE_TABLE/JOINED hierarchies where @Table, @DiscriminatorColumn, @DiscriminatorFormula, @Cache, @Immutable, @Id or @Version are declared on the wrong class of the hierarchy.","solutions":["Remove the override annotation from the subclass; the inherited property may not be overridden there."],"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"}