Class SchemaPerMultitenantPolicy
java.lang.Object
org.eclipse.persistence.descriptors.TablePerMultitenantPolicy
org.eclipse.persistence.descriptors.SchemaPerMultitenantPolicy
- All Implemented Interfaces:
- Serializable,- Cloneable,- MultitenantPolicy
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
 
- @Multitenant entities are not used
- EMF is shared across tenants
- EMF shared cache is disabled
- no @Entity defines schema to be used
- See Also:
- Author:
- Lukas Jungmann
- 
Field SummaryFields inherited from class org.eclipse.persistence.descriptors.TablePerMultitenantPolicycontextProperty, contextTenant, descriptor, tablePerTenantTables, type
- 
Constructor SummaryConstructorsConstructorDescription
- 
Method SummaryModifier and TypeMethodDescriptionclone(ClassDescriptor descriptor) INTERNAL: Multitenant policies are cloned per inheritance subclass.org.eclipse.persistence.internal.helper.DatabaseTableINTERNAL: Return the new database table associated with this tenant.org.eclipse.persistence.internal.helper.DatabaseTablegetTable(org.eclipse.persistence.internal.helper.DatabaseTable table) INTERNAL: Return the new database table associated with this tenant.protected StringgetTableName(org.eclipse.persistence.internal.helper.DatabaseTable table, String tenant) INTERNAL: Return the tenant table name.voidinitialize(org.eclipse.persistence.internal.sessions.AbstractSession session) INTERNAL:booleanINTERNAL:booleanINTERNAL:voidsetShouldUseSharedCache(boolean shouldUseSharedCache) voidsetShouldUseSharedEMF(boolean shouldUseSharedEMF) protected voidINTERNAL: This method is used to update the table per tenant descriptor with a table per tenant schema.booleanbooleanprotected org.eclipse.persistence.internal.helper.DatabaseTableupdateTable(org.eclipse.persistence.internal.helper.DatabaseTable table) INTERNAL: This method will update the table by cloning it and setting a new name on it.Methods inherited from class org.eclipse.persistence.descriptors.TablePerMultitenantPolicyaddFieldsToRow, addToTableDefinition, getContextProperty, hasContextTenant, isPrefixPerTable, isSchemaPerTable, isSingleTableMultitenantPolicy, isSuffixPerTable, postInitialize, preInitialize, setContextProperty, setContextTenant, setTablePerTenant, setTenantTableDiscriminatorType, shouldInitialize, usesContextProperty
- 
Constructor Details- 
SchemaPerMultitenantPolicypublic SchemaPerMultitenantPolicy()
- 
SchemaPerMultitenantPolicy
 
- 
- 
Method Details- 
initializepublic void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorException INTERNAL:- Specified by:
- initializein interface- MultitenantPolicy
- Overrides:
- initializein class- TablePerMultitenantPolicy
- Throws:
- DescriptorException
 
- 
cloneDescription copied from class:TablePerMultitenantPolicyINTERNAL: Multitenant policies are cloned per inheritance subclass.- Specified by:
- clonein interface- MultitenantPolicy
- Overrides:
- clonein class- TablePerMultitenantPolicy
 
- 
isSchemaPerMultitenantPolicypublic boolean isSchemaPerMultitenantPolicy()Description copied from class:TablePerMultitenantPolicyINTERNAL:- Specified by:
- isSchemaPerMultitenantPolicyin interface- MultitenantPolicy
- Overrides:
- isSchemaPerMultitenantPolicyin class- TablePerMultitenantPolicy
 
- 
setTableSchemaPerTenantprotected void setTableSchemaPerTenant()Description copied from class:TablePerMultitenantPolicyINTERNAL: 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.- Overrides:
- setTableSchemaPerTenantin class- TablePerMultitenantPolicy
 
- 
isTablePerMultitenantPolicypublic boolean isTablePerMultitenantPolicy()Description copied from class:TablePerMultitenantPolicyINTERNAL:- Specified by:
- isTablePerMultitenantPolicyin interface- MultitenantPolicy
- Overrides:
- isTablePerMultitenantPolicyin class- TablePerMultitenantPolicy
 
- 
getTableNameprotected String getTableName(org.eclipse.persistence.internal.helper.DatabaseTable table, String tenant) Description copied from class:TablePerMultitenantPolicyINTERNAL: Return the tenant table name.- Overrides:
- getTableNamein class- TablePerMultitenantPolicy
 
- 
getTablepublic org.eclipse.persistence.internal.helper.DatabaseTable getTable(org.eclipse.persistence.internal.helper.DatabaseTable table) Description copied from class:TablePerMultitenantPolicyINTERNAL: Return the new database table associated with this tenant.- Overrides:
- getTablein class- TablePerMultitenantPolicy
 
- 
getTableDescription copied from class:TablePerMultitenantPolicyINTERNAL: Return the new database table associated with this tenant.- Overrides:
- getTablein class- TablePerMultitenantPolicy
 
- 
updateTableprotected org.eclipse.persistence.internal.helper.DatabaseTable updateTable(org.eclipse.persistence.internal.helper.DatabaseTable table) Description copied from class:TablePerMultitenantPolicyINTERNAL: 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.- Overrides:
- updateTablein class- TablePerMultitenantPolicy
 
 
-