Error with multitenancy and embedded id

Hi everyone i got a problem when using multitenancy addon. When I launch the application i got this error Exception [EclipseLink-0] (Eclipse Persistence Services - 4.0.6-2-jmix.v202506091129-92af6dc76d89b52ba99c91a8aff1809612ae7fd7): org.eclipse.persistence.exceptions.JPQLException
Exception Description: Problem compiling [(:tenantId = ‘no_tenant’ or this.tenant = :tenantId)].
[28, 39] The state field path ‘this.tenant’ cannot be resolved to a valid type.
Jmix version: 2.6.0
Jmix Studio Plugin Version: 2.6.0-251
IntelliJ version: IntelliJ IDEA 2025.1.3 (Community Edition)
test.zip (1.0 MB)
Is there a way to resolve this issue? Thanks

Hello Federico!

Please, do not add tenant field to embeddable entity. It causes problems with additional criteria building.

It is better to put tenant field to standalone JPA Entity itself:

@JmixEntity
@Table(name = "CDAPEX_TMP")
@Entity
@Getter
@Setter
public class CDApexTMP {
    @EmbeddedId
    private CDapexTMPID id;
    
    // ...

    @TenantId
    @Column(name = "tenant")
    private String tenant;
}

Superclass may be used If you want to avoid adding Tenant field to each entity.

Regards,
Dmitry