Top Description Methods
org.eclipse.persistence.annotations

public @Interface TenantDiscriminatorColumn

extends Annotation
Annotations
@Target:TYPE
@Retention:RUNTIME
@Repeatable:TenantDiscriminatorColumns
Imports
java.lang.annotation.Retention, .Target, .Repeatable, jakarta.persistence.DiscriminatorType

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).
Author
Guy Pelletier
Since
EclipseLink 2.3
See Also
org.eclipse.persistence.annotations.TenantDiscriminatorColumns, org.eclipse.persistence.annotations.Multitenant, org.eclipse.persistence.annotations.MultitenantType

Method Summary

Modifier and TypeMethod and Description
public String
columnDefinition()

(Optional) The SQL fragment that is used when generating the DDL for the discriminator column.

public String
contextProperty()

(Optional) The name of the context property to apply to the tenant discriminator column.

public DiscriminatorType
discriminatorType()

(Optional) The type of object/column to use as a class discriminator.

public int
length()

(Optional) The column length for String-based discriminator types.

public String
name()

(Optional) The name of column to be used for the tenant discriminator.

public boolean
primaryKey()

Specifies that the tenant discriminator column is part of the primary key of the tables.

public String
table()

(Optional) The name of the table that contains the column.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

columnDefinitionback to summary
public 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.

contextPropertyback to summary
public String contextProperty()

(Optional) The name of the context property to apply to the tenant discriminator column.

discriminatorTypeback to summary
public DiscriminatorType discriminatorType()

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

lengthback to summary
public int length()

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

nameback to summary
public String name()

(Optional) The name of column to be used for the tenant discriminator.

primaryKeyback to summary
public boolean primaryKey()

Specifies that the tenant discriminator column is part of the primary key of the tables.

tableback to summary
public String table()

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