mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-12 22:24:47 +00:00
HHH-18151 Fix lazy loading with generics and inheritance
This commit is contained in:
parent
26c0054753
commit
08d0d78147
@ -350,7 +350,7 @@ else if ( name.equals( "getterSelf" ) ) {
|
||||
Opcodes.INVOKEVIRTUAL,
|
||||
entity.getInternalName(),
|
||||
EnhancerConstants.PERSISTENT_FIELD_READER_PREFIX + field.getName(),
|
||||
Type.getMethodDescriptor( Type.getType( field.getDescriptor() ) ),
|
||||
Type.getMethodDescriptor( Type.getType( field.asDefined().getDescriptor() ) ),
|
||||
false
|
||||
);
|
||||
}
|
||||
|
@ -261,7 +261,7 @@ DynamicType.Builder<?> applyTo(DynamicType.Builder<?> builder) {
|
||||
builder = builder
|
||||
.defineMethod(
|
||||
EnhancerConstants.PERSISTENT_FIELD_READER_PREFIX + enhancedField.getName(),
|
||||
enhancedField.getType().asErasure(),
|
||||
enhancedField.asDefined().getType().asErasure(),
|
||||
Visibility.PUBLIC
|
||||
)
|
||||
.intercept( fieldReader( enhancedField ) );
|
||||
@ -373,10 +373,10 @@ public Size apply(
|
||||
Opcodes.INVOKESPECIAL,
|
||||
managedCtClass.getSuperClass().asErasure().getInternalName(),
|
||||
EnhancerConstants.PERSISTENT_FIELD_READER_PREFIX + persistentField.getName(),
|
||||
Type.getMethodDescriptor( Type.getType( persistentField.getType().asErasure().getDescriptor() ) ),
|
||||
Type.getMethodDescriptor( Type.getType( persistentField.asDefined().getType().asErasure().getDescriptor() ) ),
|
||||
false
|
||||
);
|
||||
methodVisitor.visitInsn( Type.getType( persistentField.getType().asErasure().getDescriptor() ).getOpcode( Opcodes.IRETURN ) );
|
||||
methodVisitor.visitInsn( Type.getType( persistentField.asDefined().getType().asErasure().getDescriptor() ).getOpcode( Opcodes.IRETURN ) );
|
||||
return new Size( persistentField.getType().getStackSize().getSize(), instrumentedMethod.getStackSize() );
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user