I am trying to use @AvroName annotation in java POJO fields. However, I want these POJO fields to be inherited by the subclasses. But @AvroName annotation does not have the @Inherited annotation to it.
Is there a way to make the @AvroName annotation have @Inherited?
I was wondering if I can make a wrapper annotation but not very sure.
public abstract class Abc {
@AvroName(“field1”)
public String field1;
}
public class Xyz extends Abc {
@AvroName(“field2”)
public String field2;
}
I want my Xyz object to have both field1 and field2 with @AvroName properties.
I am not too sure if I understood the problem correctly. The fields in you Xyz class are both annotated with
@AvroName, you don't need this annotation to be annotated with@Inherited.@Inheritedonly has effect on classes.Maybe this can clear it up for you.