mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-27 22:39:13 +00:00
fix exceptions for a certain kind of wrong join column mapping
This commit is contained in:
parent
408e0ec436
commit
c7bad70073
@ -450,9 +450,8 @@ private static String handleTargetEntity(
|
||||
final ReflectionManager reflectionManager = context.getBootstrapContext().getReflectionManager();
|
||||
if ( oneToManyAnn != null ) {
|
||||
if ( joinColumns.isSecondary() ) {
|
||||
throw new AssertionFailure(
|
||||
"Collections having FK in secondary table - " + getPath( propertyHolder, inferredData )
|
||||
);
|
||||
throw new AnnotationException( "Collection '" + getPath( propertyHolder, inferredData )
|
||||
+ "' has foreign key in secondary table" );
|
||||
}
|
||||
collectionBinder.setFkJoinColumns( joinColumns );
|
||||
mappedBy = nullIfEmpty( oneToManyAnn.mappedBy() );
|
||||
@ -465,9 +464,8 @@ private static String handleTargetEntity(
|
||||
}
|
||||
else if ( elementCollectionAnn != null ) {
|
||||
if ( joinColumns.isSecondary() ) {
|
||||
throw new AssertionFailure(
|
||||
"Collections having FK in secondary table - " + getPath( propertyHolder, inferredData )
|
||||
);
|
||||
throw new AnnotationException( "Collection '" + getPath( propertyHolder, inferredData )
|
||||
+ "' has foreign key in secondary table" );
|
||||
}
|
||||
collectionBinder.setFkJoinColumns( joinColumns );
|
||||
mappedBy = null;
|
||||
|
Loading…
x
Reference in New Issue
Block a user