Top Description Fields Constructors Methods
org.eclipse.persistence.descriptors

public Class SchemaPerMultitenantPolicy

extends TablePerMultitenantPolicy
Class Inheritance
Imports
org.eclipse.persistence.annotations.TenantTableDiscriminatorType, org.eclipse.persistence.config.CacheIsolationType, .EntityManagerProperties, org.eclipse.persistence.exceptions.DescriptorException, org.eclipse.persistence.internal.helper.DatabaseTable, org.eclipse.persistence.internal.sessions.AbstractSession

A schema per tenant multitenant policy. This is a special case of TablePerMultitenantPolicy which can be applied on the project. Can be useful in cases when tenant schema change happens outside of EclipseLink, typically if Proxy DataSource is used. Use of this policy is limited to projects where following applies
Author
Lukas Jungmann
Since
EclipseLink 2.6

Field Summary

Modifier and TypeField and Description
private boolean
private boolean
Inherited from org.eclipse.persistence.descriptors.TablePerMultitenantPolicy:
contextPropertycontextTenantdescriptortablePerTenantTablestype

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public MultitenantPolicy
clone(ClassDescriptor descriptor)

Overrides org.eclipse.persistence.descriptors.TablePerMultitenantPolicy.clone.

Implements org.eclipse.persistence.descriptors.MultitenantPolicy.clone.

INTERNAL: Multitenant policies are cloned per inheritance subclass.
public DatabaseTable
getTable(DatabaseTable table)

Overrides org.eclipse.persistence.descriptors.TablePerMultitenantPolicy.getTable.

INTERNAL: Return the new database table associated with this tenant.
public DatabaseTable
getTable(String tableName)

Overrides org.eclipse.persistence.descriptors.TablePerMultitenantPolicy.getTable.

INTERNAL: Return the new database table associated with this tenant.
protected String
public void
public boolean
public boolean
public void
setShouldUseSharedCache(boolean shouldUseSharedCache)

public void
setShouldUseSharedEMF(boolean shouldUseSharedEMF)

protected void
setTableSchemaPerTenant()

Overrides org.eclipse.persistence.descriptors.TablePerMultitenantPolicy.setTableSchemaPerTenant.

INTERNAL: This method is used to update the table per tenant descriptor with a table per tenant schema.
public boolean
public boolean
protected DatabaseTable
updateTable(DatabaseTable table)

Overrides org.eclipse.persistence.descriptors.TablePerMultitenantPolicy.updateTable.

INTERNAL: This method will update the table by cloning it and setting a new name on it.
Inherited from org.eclipse.persistence.descriptors.TablePerMultitenantPolicy:
addFieldsToRowaddToTableDefinitiongetContextPropertyhasContextTenantisPrefixPerTableisSchemaPerTableisSingleTableMultitenantPolicyisSuffixPerTablepostInitializepreInitializesetContextPropertysetContextTenantsetTablePerTenantsetTenantTableDiscriminatorTypeshouldInitializeusesContextProperty

Field Detail

useSharedCacheback to summary
private boolean useSharedCache
useSharedEMFback to summary
private boolean useSharedEMF

Constructor Detail

SchemaPerMultitenantPolicyback to summary
public SchemaPerMultitenantPolicy()
SchemaPerMultitenantPolicyback to summary
public SchemaPerMultitenantPolicy(ClassDescriptor desc)

Method Detail

cloneback to summary
public MultitenantPolicy clone(ClassDescriptor descriptor)

Overrides org.eclipse.persistence.descriptors.TablePerMultitenantPolicy.clone.

Implements org.eclipse.persistence.descriptors.MultitenantPolicy.clone.

Doc from org.eclipse.persistence.descriptors.TablePerMultitenantPolicy.clone.

INTERNAL: Multitenant policies are cloned per inheritance subclass.

Annotations
@Override
getTableback to summary
public DatabaseTable getTable(DatabaseTable table)

Overrides org.eclipse.persistence.descriptors.TablePerMultitenantPolicy.getTable.

Doc from org.eclipse.persistence.descriptors.TablePerMultitenantPolicy.getTable.

INTERNAL: Return the new database table associated with this tenant.

Annotations
@Override
getTableback to summary
public DatabaseTable getTable(String tableName)

Overrides org.eclipse.persistence.descriptors.TablePerMultitenantPolicy.getTable.

Doc from org.eclipse.persistence.descriptors.TablePerMultitenantPolicy.getTable.

INTERNAL: Return the new database table associated with this tenant.

Annotations
@Override
getTableNameback to summary
protected String getTableName(DatabaseTable table, String tenant)

Overrides org.eclipse.persistence.descriptors.TablePerMultitenantPolicy.getTableName.

Doc from org.eclipse.persistence.descriptors.TablePerMultitenantPolicy.getTableName.

INTERNAL: Return the tenant table name.

Annotations
@Override
initializeback to summary
public void initialize(AbstractSession session) throws DescriptorException

Overrides org.eclipse.persistence.descriptors.TablePerMultitenantPolicy.initialize.

Implements org.eclipse.persistence.descriptors.MultitenantPolicy.initialize.

INTERNAL:

Annotations
@Override
isSchemaPerMultitenantPolicyback to summary
public boolean isSchemaPerMultitenantPolicy()

Overrides org.eclipse.persistence.descriptors.TablePerMultitenantPolicy.isSchemaPerMultitenantPolicy.

Implements org.eclipse.persistence.descriptors.MultitenantPolicy.isSchemaPerMultitenantPolicy.

Doc from org.eclipse.persistence.descriptors.TablePerMultitenantPolicy.isSchemaPerMultitenantPolicy.

INTERNAL:

Annotations
@Override
isTablePerMultitenantPolicyback to summary
public boolean isTablePerMultitenantPolicy()

Overrides org.eclipse.persistence.descriptors.TablePerMultitenantPolicy.isTablePerMultitenantPolicy.

Implements org.eclipse.persistence.descriptors.MultitenantPolicy.isTablePerMultitenantPolicy.

Doc from org.eclipse.persistence.descriptors.TablePerMultitenantPolicy.isTablePerMultitenantPolicy.

INTERNAL:

Annotations
@Override
setShouldUseSharedCacheback to summary
public void setShouldUseSharedCache(boolean shouldUseSharedCache)
setShouldUseSharedEMFback to summary
public void setShouldUseSharedEMF(boolean shouldUseSharedEMF)
setTableSchemaPerTenantback to summary
protected void setTableSchemaPerTenant()

Overrides org.eclipse.persistence.descriptors.TablePerMultitenantPolicy.setTableSchemaPerTenant.

Doc from org.eclipse.persistence.descriptors.TablePerMultitenantPolicy.setTableSchemaPerTenant.

INTERNAL: This method is used to update the table per tenant descriptor with a table per tenant schema. This includes any relation tables from mappings. This will be done through the setting of a table qualifier on the tables. This method should only be called at the start of a client session lifecycle and should only be called once.

Annotations
@Override
shouldUseSharedCacheback to summary
public boolean shouldUseSharedCache()
shouldUseSharedEMFback to summary
public boolean shouldUseSharedEMF()
updateTableback to summary
protected DatabaseTable updateTable(DatabaseTable table)

Overrides org.eclipse.persistence.descriptors.TablePerMultitenantPolicy.updateTable.

Doc from org.eclipse.persistence.descriptors.TablePerMultitenantPolicy.updateTable.

INTERNAL: This method will update the table by cloning it and setting a new name on it. The table association will be stored here as well for ease of future look up.

Annotations
@Override