diff --git a/bom/pom.xml b/bom/pom.xml index 08bbe283bab76..104af4f08d41c 100644 --- a/bom/pom.xml +++ b/bom/pom.xml @@ -92,7 +92,7 @@ 1.3.4 3.0.1.b11 6.1.0.Alpha4 - 5.4.2.Final + 5.4.3.Final 6.0.0.Alpha6 5.9.3.Final 1.1.1.Final diff --git a/extensions/panache/hibernate-orm-panache/deployment/src/main/java/io/quarkus/hibernate/orm/panache/deployment/EntityField.java b/extensions/panache/hibernate-orm-panache/deployment/src/main/java/io/quarkus/hibernate/orm/panache/deployment/EntityField.java index 1845c79b95dce..833665fcbe617 100644 --- a/extensions/panache/hibernate-orm-panache/deployment/src/main/java/io/quarkus/hibernate/orm/panache/deployment/EntityField.java +++ b/extensions/panache/hibernate-orm-panache/deployment/src/main/java/io/quarkus/hibernate/orm/panache/deployment/EntityField.java @@ -4,6 +4,7 @@ public class EntityField { final String name; final String descriptor; + String signature; public EntityField(String name, String descriptor) { this.name = name; diff --git a/extensions/panache/hibernate-orm-panache/deployment/src/main/java/io/quarkus/hibernate/orm/panache/deployment/PanacheJpaEntityEnhancer.java b/extensions/panache/hibernate-orm-panache/deployment/src/main/java/io/quarkus/hibernate/orm/panache/deployment/PanacheJpaEntityEnhancer.java index fde9bb84927f3..8c505a79b4624 100644 --- a/extensions/panache/hibernate-orm-panache/deployment/src/main/java/io/quarkus/hibernate/orm/panache/deployment/PanacheJpaEntityEnhancer.java +++ b/extensions/panache/hibernate-orm-panache/deployment/src/main/java/io/quarkus/hibernate/orm/panache/deployment/PanacheJpaEntityEnhancer.java @@ -79,8 +79,10 @@ public ModelEnhancingClassVisitor(String className, ClassVisitor outputClassVisi @Override public FieldVisitor visitField(int access, String name, String descriptor, String signature, Object value) { FieldVisitor superVisitor = super.visitField(access, name, descriptor, signature, value); - if (fields == null || !fields.containsKey(name)) + EntityField ef = fields.get(name); + if (fields == null || ef == null) return superVisitor; + ef.signature = signature; // if we have a mapped field, let's add some annotations return new FieldVisitor(Opcodes.ASM6, superVisitor) { private Set descriptors = new HashSet<>(); @@ -340,7 +342,7 @@ private void generateAccessors() { String getterDescriptor = "()" + field.descriptor; if (!methods.contains(getterName + "/" + getterDescriptor)) { MethodVisitor mv = super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_SYNTHETIC, - getterName, getterDescriptor, null, null); + getterName, getterDescriptor, field.signature == null ? null : "()" + field.signature, null); mv.visitCode(); mv.visitIntInsn(Opcodes.ALOAD, 0); // Due to https://github.com/quarkusio/quarkus/issues/1376 we generate Hibernate read/write calls @@ -385,7 +387,7 @@ private void generateAccessors() { String setterDescriptor = "(" + field.descriptor + ")V"; if (!methods.contains(setterName + "/" + setterDescriptor)) { MethodVisitor mv = super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_SYNTHETIC, - setterName, setterDescriptor, null, null); + setterName, setterDescriptor, field.signature == null ? null : "(" + field.signature + ")V", null); mv.visitCode(); mv.visitIntInsn(Opcodes.ALOAD, 0); int loadCode;