Hello

I am experimenting with Apache Ignite 3 and working on creating tables from
annotated POJOs.
It appears that Apache Ignite 3 does not fully support class inheritance
when processing annotated POJOs.

After some investigation, I traced the issue to the class
CreateFromAnnotationsImpl, processColumnsInPojo method, at line 199 in
Ignite 3.0 release, or line 204 in latest
https://github.com/apache/ignite-3/blob/main/modules/catalog-dsl/src/main/java/org/apache/ignite/internal/catalog/sql/CreateFromAnnotationsImpl.java

private static void processColumnsInPojo(CreateTableImpl createTable,
Class<?> clazz, List<ColumnSorted> idColumns) {
    for (Field f : clazz.getDeclaredFields()) {
        if (Modifier.isStatic(f.getModifiers()) ||
Modifier.isTransient(f.getModifiers())) {
            continue;
        }
    ...

By retrieving only the fields declared in the class (using
clazz.getDeclaredFields()) and not those inherited from a superclass (as
clazz.getFields() would do), inheritance support is effectively broken.

Could someone please confirm whether inheritance is supposed to be fully
supported and this is a bug in the current implementation, or if the
intention is to only support class-declared fields and not inherited ones?

I can provide a minimal reproducible set of source files, but the issue is
evident in class CreateFromAnnotationsImpl, so this is just to understand
whether it is designed to be so, or not.

Thank you
Cheers
Gianluca Bonetti

Reply via email to