Thank you for this wonderful library. However, I am stuck at one point. I am able to add annotations to a field/method, but not able to replace or remove existing annotation.
I have the following requirement, on a method,
@OneToOne (fetch = FetchType.LAZY) // I want to remove / replace annotation values
public Employee getEmployee()
I would like to,
- Remove the existing annotation
@OneToOne (fetch = FetchType.LAZY)
- Replace the existing annotation's values with
@OneToOne (fetch = FetchType.EAGER)
I am using the bytebuddy maven plugin, using the DynamicType.Builder to visit the method to add new annotation using MemberAttributeExtension.ForMethod().annotateMethod(), but not sure how to remove or replace existing annotations.
I tried using MemberSubstitution, but did not get that to work for removing / replacing annotations
For your help I will be immensely grateful.
Thank you for this wonderful library. However, I am stuck at one point. I am able to add annotations to a field/method, but not able to replace or remove existing annotation.
I have the following requirement, on a method,
I would like to,
@OneToOne (fetch = FetchType.LAZY)@OneToOne (fetch = FetchType.EAGER)I am using the bytebuddy maven plugin, using the
DynamicType.Buildertovisitthe method to add new annotation usingMemberAttributeExtension.ForMethod().annotateMethod(), but not sure how to remove or replace existing annotations.I tried using
MemberSubstitution, but did not get that to work for removing / replacing annotationsFor your help I will be immensely grateful.