diff --git a/hibernate-core/src/main/java/org/hibernate/boot/model/internal/EntityBinder.java b/hibernate-core/src/main/java/org/hibernate/boot/model/internal/EntityBinder.java index 5d23c03bb7..c22405753a 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/model/internal/EntityBinder.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/model/internal/EntityBinder.java @@ -910,7 +910,7 @@ public class EntityBinder { } private static void handleForeignKeys(ClassDetails clazzToProcess, MetadataBuildingContext context, DependantValue key) { - final AnnotationUsage pkJoinColumn = clazzToProcess.getAnnotationUsage( PrimaryKeyJoinColumn.class ); + final AnnotationUsage pkJoinColumn = clazzToProcess.getSingleAnnotationUsage( PrimaryKeyJoinColumn.class ); final AnnotationUsage pkJoinColumns = clazzToProcess.getAnnotationUsage( PrimaryKeyJoinColumns.class ); final boolean noConstraintByDefault = context.getBuildingOptions().isNoConstraintByDefault(); if ( pkJoinColumn != null && noConstraint( pkJoinColumn.getNestedUsage( "foreignKey" ), noConstraintByDefault )