Skip to content

Commit

Permalink
Merge pull request #2672 from gsmet/upgrade-hibernate-orm-543
Browse files Browse the repository at this point in the history
Upgrade Hibernate ORM to 5.4.3
  • Loading branch information
mkouba authored Jun 3, 2019
2 parents 2f60ce3 + 6fef5e5 commit fab92ee
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
<classmate.version>1.3.4</classmate.version>
<javax.el-impl.version>3.0.1.b11</javax.el-impl.version>
<hibernate-validator.version>6.1.0.Alpha4</hibernate-validator.version>
<hibernate-orm.version>5.4.2.Final</hibernate-orm.version>
<hibernate-orm.version>5.4.3.Final</hibernate-orm.version>
<hibernate-search.version>6.0.0.Alpha6</hibernate-search.version>
<narayana.version>5.9.3.Final</narayana.version>
<jboss-transaction-api_1.2_spec.version>1.1.1.Final</jboss-transaction-api_1.2_spec.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ public class EntityField {

final String name;
final String descriptor;
String signature;

public EntityField(String name, String descriptor) {
this.name = name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> descriptors = new HashSet<>();
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit fab92ee

Please sign in to comment.