Java Persistence API (JPA) Extensions Reference for EclipseLink, Release 2.4
  Go To Table Of Contents
 Search
 PDFComments
Comments


@TenantDiscriminatorColumns

Specify multiple discriminator columns for single-table multitenancy by using the @TenantDiscriminatorColumns annotation to contain multiple @TenantDiscriminatorColumn annotations.


Annotation Elements

Table 2-68 describes this annotation's elements.

Table 2-68 @TenantDiscriminatorColumns Annotation Elements

Annotation Element Description Default

TenantDiscriminatorColumn value

(Optional) One or more TenantDiscriminatorColumn annotations.

none



Usage

You must use the @TenantDiscriminatorColumns annotation to contain multiple @TenantDiscriminatorColumn annotations. The @TenantDiscriminatorColumns annotation cannot be used alone, and multiple the @TenantDiscriminatorColumn annotations cannot be used alone, without @TenantDiscriminatorColumns.


Examples

@Entity 
@Table(name = "EMPLOYEE") 
@Multitenant(SINGLE_TABLE) 
@TenantDiscriminatorColumns({ 
    @TenantDiscriminatorColumn(name = "TENANT_ID", contextProperty = “tenant-id)
    @TenantDiscriminatorColumn(name = "TENANT_CODE", contextProperty = “tenant-code)})

See "@TenantDiscriminatorColumn" for more examples of @TenantDiscriminatorColumns.


See Also