Multitenancy problem

Hello!
I have a Cuba project that I want to make multitenant. In the project, I have a UserExt entity that worked ok before. After I installed the Multitenancy addon, I have the next problem :
’ class com.haulmont.cuba.security.entity.User is already extended by class com.haulmont.sdbmtsample.entity.UserExt ’

Platform Version is: 7.2.9
Multitenancy: 2.0.2

I used your demo project ‘multitenancy-addon-demo-master’ where I added a new entity UserExt and the problem persist.
I saw that TenantUser is deprecated and if I use it I have another problem.

I am open to suggestions and thank you!

Hello @bogdan

You need to extends UserExt.class from TenantUser.class

Example:

@Entity(name = "sample_UserExt")
@Extends(User.class)
public class UserExt extends User {
   ...
}

Also you need to check the dtype column in your database. The column should contain the name of your extended entity.

Example:

image

Regards,
Nikita

Hello, thanks for the reply!
I made these changes as you said but using TenantUser.class I have the next problem:

cannot find symbol
Capture

Thanks again for the help!

Should be com.haulmont.addon.sdbmt.entity.TenantUser I guess … (without the Q)

This is an auto-generated file from QueryDSL and it’s not editable.

QUserExt is a Querydsl query type for UserExt and in this class I have the problem.