Module org.seasar.doma.core
Package org.seasar.doma.jdbc.entity
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 propertyBASIC- the basic type of the tenant ID propertyCONTAINER- 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:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.seasar.doma.jdbc.entity.DefaultPropertyType
DefaultPropertyType.DefaultProperty -
Field Summary
Fields inherited from class org.seasar.doma.jdbc.entity.DefaultPropertyType
columnName, columnType, entityClass, field, insertable, name, namingType, prefix, quoteRequired, scalarSupplier, simpleName, updatable -
Constructor Summary
ConstructorsConstructorDescriptionTenantIdPropertyType(Class<ENTITY> entityClass, Supplier<Scalar<BASIC, CONTAINER>> scalarSupplier, String name, String columnName, NamingType namingType, boolean quoteRequired) Constructs a new tenant ID property type. -
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermines whether this property represents a tenant identifier for multi-tenancy.Methods inherited from class org.seasar.doma.jdbc.entity.DefaultPropertyType
copy, createProperty, getColumnName, getColumnName, getColumnName, getColumnName, getName, isId, isInsertable, isQuoteRequired, isUpdatable, isVersion, modifyIfNecessary
-
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 classscalarSupplier- the supplier of scalar that represents the property valuename- the property namecolumnName- the column namenamingType- the naming conventionquoteRequired- 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
truesince this property type represents a tenant ID property.- Specified by:
isTenantIdin interfaceEntityPropertyType<ENTITY,BASIC> - Overrides:
isTenantIdin classDefaultPropertyType<ENTITY,BASIC, CONTAINER> - Returns:
true- See Also:
-