The underlying problem is pretty bad. The enhancement assumes that the field name always matches the “attribute name”, which is not necessarily true for PROPERTY access. The test in question, e.g., defines this entity:
@Entity
public static class Spouse {
...
private String last;
@Id
Integer getId() {...};
String getLastName() {...};
void setLastName(String name) {...};
}
Here, we have PROPERTY access (placement of @Id) and thus a persistent attribute named lastName. The enhancement code however basis this decision on the field-name assuming it is the same thing as the attribute name. Here, it is (perfectly legally) not. Rafael Winterhalter or any other ByteBuddy experts have thoughts on this? |