HHH-17420 JoinColumn throws an AnnotationException
This commit is contained in:
parent
2ae10fafd2
commit
f24669ca93
|
@ -452,9 +452,16 @@ public class BinderHelper {
|
|||
// which are mapped to that column. (There might be multiple such
|
||||
// properties for each column.)
|
||||
if ( columnOwner instanceof PersistentClass ) {
|
||||
PersistentClass persistentClass = (PersistentClass) columnOwner;
|
||||
final PersistentClass persistentClass = (PersistentClass) columnOwner;
|
||||
// Process ToOne associations after Components, Basic and Id properties
|
||||
final List<Property> toOneProperties = new ArrayList<>();
|
||||
for ( Property property : persistentClass.getReferenceableProperties() ) {
|
||||
matchColumnsByProperty( property, columnsToProperty );
|
||||
if ( property.getValue() instanceof ToOne ) {
|
||||
toOneProperties.add( property );
|
||||
}
|
||||
else {
|
||||
matchColumnsByProperty( property, columnsToProperty );
|
||||
}
|
||||
}
|
||||
if ( persistentClass.hasIdentifierProperty() ) {
|
||||
matchColumnsByProperty( persistentClass.getIdentifierProperty(), columnsToProperty );
|
||||
|
@ -466,6 +473,9 @@ public class BinderHelper {
|
|||
matchColumnsByProperty( p, columnsToProperty );
|
||||
}
|
||||
}
|
||||
for ( Property property : toOneProperties ) {
|
||||
matchColumnsByProperty( property, columnsToProperty );
|
||||
}
|
||||
}
|
||||
else {
|
||||
for ( Property property : ((Join) columnOwner).getProperties() ) {
|
||||
|
|
Loading…
Reference in New Issue