EclipseLink 2.3.2, build 'v20111125-r10461' API Reference

org.eclipse.persistence.annotations
Annotation Type TenantDiscriminatorColumn


@Target(value=TYPE)
@Retention(value=RUNTIME)
public @interface TenantDiscriminatorColumn

Tenant discriminator column(s) are used with a SINGLE_TABLE multitenant strategy. Tenant discriminator column(s) are completely user specified and there is no limit on how many tenant discriminator columns an application can define (using the TenantDiscriminatorColumns annotation) Tenant discriminator column(s) can be specified at the Entity or MappedSuperclass level and must always be accompanied with a Multitenant(SINGLE_TABLE) specification. It is not sufficient to specify only tenant discriminator column(s).

See Also:
TenantDiscriminatorColumns, Multitenant, MultitenantType
Author:
Guy Pelletier
Since:
EclipseLink 2.3

Optional Element Summary
 java.lang.String columnDefinition
          (Optional) The SQL fragment that is used when generating the DDL for the discriminator column.
 java.lang.String contextProperty
          (Optional) The name of the context property to apply to the tenant discriminator column.
 DiscriminatorType discriminatorType
          (Optional) The type of object/column to use as a class discriminator.
 int length
          (Optional) The column length for String-based discriminator types.
 java.lang.String name
          (Optional) The name of column to be used for the tenant discriminator.
 boolean primaryKey
          Specifies that the tenant discriminator column is part of the primary key of the tables.
 java.lang.String table
          (Optional) The name of the table that contains the column.
 

name

public abstract java.lang.String name
(Optional) The name of column to be used for the tenant discriminator.

Default:
"TENANT_ID"

contextProperty

public abstract java.lang.String contextProperty
(Optional) The name of the context property to apply to the tenant discriminator column.

Default:
"eclipselink.tenant-id"

discriminatorType

public abstract DiscriminatorType discriminatorType
(Optional) The type of object/column to use as a class discriminator. Defaults to DiscriminatorType.STRING.

Default:
javax.persistence.DiscriminatorType.STRING

columnDefinition

public abstract java.lang.String columnDefinition
(Optional) The SQL fragment that is used when generating the DDL for the discriminator column.

Defaults to the provider-generated SQL to create a column of the specified discriminator type.

Default:
""

length

public abstract int length
(Optional) The column length for String-based discriminator types. Ignored for other discriminator types.

Default:
31

table

public abstract java.lang.String table
(Optional) The name of the table that contains the column. If absent the column is assumed to be in the primary table.

Default:
""

primaryKey

public abstract boolean primaryKey
Specifies that the tenant discriminator column is part of the primary key of the tables.

Default:
false

EclipseLink 2.3.2, build 'v20111125-r10461' API Reference