Class TenantIdPropertyType<ENTITY,BASIC,CONTAINER>

java.lang.Object
org.seasar.doma.jdbc.entity.DefaultPropertyType<ENTITY,BASIC,CONTAINER>
org.seasar.doma.jdbc.entity.TenantIdPropertyType<ENTITY,BASIC,CONTAINER>
Type Parameters:
ENTITY - the entity type containing this tenant ID property
BASIC - the basic type of the tenant ID property
CONTAINER - the container type of the tenant ID property
All Implemented Interfaces:
EntityPropertyType<ENTITY,BASIC>

public class TenantIdPropertyType<ENTITY,BASIC,CONTAINER> extends DefaultPropertyType<ENTITY,BASIC,CONTAINER>
Represents a property in an entity class that is used for multi-tenancy support.

A tenant ID property is annotated with TenantId and contains a value that identifies the tenant to which the entity belongs. This property is automatically included in WHERE clauses for entity operations to ensure data isolation between tenants.

Implementations of this class are typically generated at compile time by the Doma annotation processor.

See Also:
  • Constructor Details

    • TenantIdPropertyType

      public TenantIdPropertyType(Class<ENTITY> entityClass, Supplier<Scalar<BASIC,CONTAINER>> scalarSupplier, String name, String columnName, NamingType namingType, boolean quoteRequired)
      Constructs a new tenant ID property type.

      This constructor is typically called by the Doma annotation processor when generating implementations of EntityType.

      Parameters:
      entityClass - the entity class
      scalarSupplier - the supplier of scalar that represents the property value
      name - the property name
      columnName - the column name
      namingType - the naming convention
      quoteRequired - whether the column name requires quoting in SQL
  • Method Details

    • isTenantId

      public boolean isTenantId()
      Determines whether this property represents a tenant identifier for multi-tenancy.

      This method indicates if the property is annotated with TenantId, which marks it as a tenant identifier column used for multi-tenant database access.

      This implementation always returns true since this property type represents a tenant ID property.

      Specified by:
      isTenantId in interface EntityPropertyType<ENTITY,BASIC>
      Overrides:
      isTenantId in class DefaultPropertyType<ENTITY,BASIC,CONTAINER>
      Returns:
      true
      See Also: