Eclipselink enhancing produces incorrect results on multimodule project with multitenancy - tenantId always null

In every project, I create 2 base entity classes that are reused in all of my projects. I never had any issue with them.

I’m now experimenting with creating addons, and decided to put those in a core addon.
Since then, null values are always being inserted for my tenantId.

The TenantPersistingListener is called correctly, and the tenantId field on the entity is effectively being set. But the moment the data is being flusehd to the db, it tries to insert null.

I did some very deep debugging and finally found out that the problem has to do with the eclipselink enhancing. I can get it working if I change the access mode for that specific field to property.
Note that all the other fields on BaseEntity are being filled in just fine.
I have no clue what could be the difference between those fields.

I assume the tenantId field is getting shadowed in the subclasses and switching resolved the value via the getter.

It doesn’t matter if the entities are in the same or in different modules/addons. I also made sure to put a concrete subclass together with the mapped superclasses. So this error should not be the cause.

“Jmix: @MappedSuperclass entity will be enhanced incorrectly if there is no inheritors in the same module”

Note also that due to changing the access from field to property, I have to do the column declaration twice. If i don’t then column name vs query is incorrectly resolved and you get a mismatch regarding liquibase scripts vs code (tenantId vs TENANT_ID)

    @Column(name = "TENANT_ID", nullable = false)

This is the modified BaseTenantEntity

@JmixEntity
@MappedSuperclass
public abstract class BaseTenantEntity extends BaseEntity {
    @SystemLevel
    @TenantId
    @Column(name = "TENANT_ID", nullable = false)
    private String tenantId;

    @Access(AccessType.PROPERTY)
    @Column(name = "TENANT_ID", nullable = false)
    public String getTenantId() {
        return tenantId;
    }

    public void setTenantId(String tenantId) {
        this.tenantId = tenantId;
    }
}


These are the classes I use in every other project.

@Getter
@Setter
@JmixEntity
@MappedSuperclass
public abstract class BaseTenantEntity extends BaseEntity {
    @SystemLevel
    @TenantId
    @Column(name = "TENANT_ID", nullable = false)
    private String tenantId;
}



@Getter
@Setter
@JmixEntity
@MappedSuperclass
public class BaseEntity {
    @Id
    @Column(name = "ID")
    @JmixGeneratedValue
    private UUID id;

    @Version
    @Column(name = "VERSION", nullable = false)
    private Integer version;

    @CreatedBy
    @Column(name = "CREATED_BY")
    private String createdBy;

    @CreatedDate
    @Temporal(TemporalType.DATE)
    @Column(name = "CREATED_DATE")
    private Date createdDate;

    @LastModifiedBy
    @Column(name = "LAST_MODIFIED_BY")
    private String lastModifiedBy;

    @LastModifiedDate
    @Temporal(TemporalType.DATE)
    @Column(name = "LAST_MODIFIED_DATE")
    private Date lastModifiedDate;

    @DeletedBy
    @Column(name = "DELETED_BY")
    private String deletedBy;

    @DeletedDate
    @Temporal(TemporalType.DATE)
    @Column(name = "DELETED_DATE")
    private Date deletedDate;
}