{"record":{"id":"f97c9baa9b6d650b","repo":"hibernate/hibernate-orm","slug":"property-getpath-propertyholder-inferreddat-f97c9b","errorCode":null,"errorMessage":"Property '\" + getPath( propertyHolder, inferredData ) + \"' is a '@ManyToOne' association and may not use '@Column' to specify column mappings (use '@JoinColumn' instead)","messagePattern":"Property '\" \\+ getPath\\( propertyHolder, inferredData \\) \\+ \"' is a '@ManyToOne' association and may not use '@Column' to specify column mappings \\(use '@JoinColumn' instead\\)","errorType":"exception","errorClass":"AnnotationException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/boot/model/internal/ToOneBinder.java","lineNumber":85,"sourceCode":" * @author Emmanuel Bernard\n */\npublic class ToOneBinder {\n\n\tstatic void bindManyToOne(\n\t\t\tPropertyHolder propertyHolder,\n\t\t\tNullability nullability,\n\t\t\tPropertyData inferredData,\n\t\t\tboolean isIdentifierMapper,\n\t\t\tboolean inSecondPass,\n\t\t\tMetadataBuildingContext context,\n\t\t\tAnnotatedJoinColumns joinColumns,\n\t\t\tPropertyBinder propertyBinder) {\n\t\tfinal var memberDetails = inferredData.getAttributeMember();\n\t\tfinal var manyToOne = memberDetails.getDirectAnnotationUsage( ManyToOne.class );\n\n\t\t//check validity\n\t\tif ( memberDetails.hasDirectAnnotationUsage( Column.class ) ) {\n\t\t\tthrow new AnnotationException(\n\t\t\t\t\t\"Property '\" + getPath( propertyHolder, inferredData )\n\t\t\t\t\t\t\t+ \"' is a '@ManyToOne' association and may not use '@Column' to specify column mappings (use '@JoinColumn' instead)\"\n\t\t\t);\n\t\t}\n\n\t\tif ( joinColumns.hasMappedBy()\n\t\t\t\t&& isIdentifier( propertyHolder, propertyBinder, isIdentifierMapper ) ) {\n\t\t\tthrow new AnnotationException(\n\t\t\t\t\t\"Property '\" + getPath( propertyHolder, inferredData )\n\t\t\t\t\t\t\t+ \"' is the inverse side of a '@ManyToOne' association and cannot be used as identifier\"\n\t\t\t);\n\t\t}\n\n\t\tbindManyToOne(\n\t\t\t\taggregateCascadeTypes( manyToOne.cascade(), memberDetails, false, context ),\n\t\t\t\tjoinColumns,\n\t\t\t\tpropertyHolder,\n\t\t\t\tnullability,","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/boot/model/internal/ToOneBinder.java#L67-L103","documentation":"Error \"Property '\" + getPath( propertyHolder, inferredData ) + \"' is a '@ManyToOne' association and may not use '@Column' to specify column mappings (use '@JoinColumn' instead)\" thrown in hibernate/hibernate-orm.","triggerScenarios":"A '@JoinColumn' / 'referencedColumnName' does not line up with the columns mapped by the target entity.","commonSituations":"Composite foreign keys, associations to entities with secondary tables, or reordered/duplicated referencedColumnName values across multiple @JoinColumn declarations.","solutions":["Replace @Column with @JoinColumn on the @ManyToOne association."],"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"}