Adding MultiTenancy

Just having a play with the MultiTenancy Addon.

So I have followed instuctions here: https://github.com/Haulmont/jmix-multitenancy#readme

Just wondering, is the tenant automatically assigned to the creation of a new entity aswell? This is not happening for me…
i.e. I have created a new entity

public class MyEntity implements AcceptsTenant {
@JmixGeneratedValue
@Column(name = "ID", nullable = false)
@Id
private UUID id;

@TenantId
@Column(name = "TENANT_ID")
protected String tenantId;

But if I create a new entity logged in as a certain tenant the tenant id is not added.
Also any user can see any of these entities -> they are not being filtered by tenant.

Am i missing another interface or something?

Hi @daryn

Did you add an attribute

   @TenantId
   @Column(name = "TENANT_ID")
   protected String tenantId;

to the User entity as described here?

Also have a look to the sample project with multitenancy add-on.

Regards,
Nadezhda.

Actually, silly me.

Had not created setter for tenantId in User class.

Might be a good idea to add to documentation for those like me who follow instuctions with minimal thinking :smiley: