Annotation Interface TenantId


@Target(FIELD) @Retention(RUNTIME) public @interface TenantId
Indicates a field that represents the tenant identifier in a multi-tenant application.

The annotated field must be a member of an Entity annotated class.

The column mapped to the annotated field is automatically included in the WHERE clause of auto-generated SQL statements to ensure proper data isolation between tenants.

 @Entity
 public class Employee {
     ...

     @TenantId
     String tenantId;
 }