HHH-17755 make @MapsId work correctly with @IdClass
the @Id property was not getting populated
This commit is contained in:
parent
3812641430
commit
312ed3c3f3
|
@ -887,14 +887,16 @@ public class BinderHelper {
|
||||||
.toXClass( propertyHolder.getPersistentClass().getMappedClass() );
|
.toXClass( propertyHolder.getPersistentClass().getMappedClass() );
|
||||||
final InFlightMetadataCollector metadataCollector = buildingContext.getMetadataCollector();
|
final InFlightMetadataCollector metadataCollector = buildingContext.getMetadataCollector();
|
||||||
if ( propertyHolder.isInIdClass() ) {
|
if ( propertyHolder.isInIdClass() ) {
|
||||||
final PropertyData propertyData = metadataCollector.getPropertyAnnotatedWithIdAndToOne( mappedClass, propertyName );
|
final PropertyData data = metadataCollector.getPropertyAnnotatedWithIdAndToOne( mappedClass, propertyName );
|
||||||
return propertyData == null && buildingContext.getBuildingOptions().isSpecjProprietarySyntaxEnabled()
|
if ( data != null ) {
|
||||||
? metadataCollector.getPropertyAnnotatedWithMapsId( mappedClass, propertyName )
|
return data;
|
||||||
: propertyData;
|
}
|
||||||
}
|
// TODO: is this branch even necessary?
|
||||||
else {
|
else if ( buildingContext.getBuildingOptions().isSpecjProprietarySyntaxEnabled() ) {
|
||||||
return metadataCollector.getPropertyAnnotatedWithMapsId( mappedClass, isId ? "" : propertyName );
|
return metadataCollector.getPropertyAnnotatedWithMapsId( mappedClass, propertyName );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return metadataCollector.getPropertyAnnotatedWithMapsId( mappedClass, isId ? "" : propertyName );
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Map<String,String> toAliasTableMap(SqlFragmentAlias[] aliases){
|
public static Map<String,String> toAliasTableMap(SqlFragmentAlias[] aliases){
|
||||||
|
|
Loading…
Reference in New Issue