HHH-13054 handle referencedColumnName to entities with multiple @Id properties
This commit is contained in:
parent
1f4c8f7b19
commit
b6792bdb19
|
@ -430,7 +430,16 @@ public class BinderHelper {
|
||||||
for ( Property property : persistentClass.getProperties() ) {
|
for ( Property property : persistentClass.getProperties() ) {
|
||||||
matchColumnsByProperty( property, columnsToProperty );
|
matchColumnsByProperty( property, columnsToProperty );
|
||||||
}
|
}
|
||||||
matchColumnsByProperty( persistentClass.getIdentifierProperty(), columnsToProperty );
|
if ( persistentClass.hasIdentifierProperty() ) {
|
||||||
|
matchColumnsByProperty( persistentClass.getIdentifierProperty(), columnsToProperty );
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// special case for entities with multiple @Id properties
|
||||||
|
Component key = persistentClass.getIdentifierMapper();
|
||||||
|
for ( Property p : key.getProperties() ) {
|
||||||
|
matchColumnsByProperty( p, columnsToProperty );
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
for ( Property property : ((Join) columnOwner).getProperties() ) {
|
for ( Property property : ((Join) columnOwner).getProperties() ) {
|
||||||
|
|
|
@ -52,7 +52,8 @@ public class EntityTypeImpl<J>
|
||||||
persistentClass.getEntityName(),
|
persistentClass.getEntityName(),
|
||||||
javaType,
|
javaType,
|
||||||
superType,
|
superType,
|
||||||
persistentClass.getDeclaredIdentifierMapper() != null || ( superType != null && superType.hasIdClass() ),
|
persistentClass.getDeclaredIdentifierMapper() != null
|
||||||
|
|| superType != null && superType.hasIdClass(),
|
||||||
persistentClass.hasIdentifierProperty(),
|
persistentClass.hasIdentifierProperty(),
|
||||||
persistentClass.isVersioned(),
|
persistentClass.isVersioned(),
|
||||||
jpaMetamodel
|
jpaMetamodel
|
||||||
|
|
Loading…
Reference in New Issue