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 Summary
Fields inherited from class org.eclipse.persistence.descriptors.TablePerMultitenantPolicy
contextProperty, contextTenant, descriptor, tablePerTenantTables, type
-
Constructor Summary
ConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionclone
(ClassDescriptor descriptor) INTERNAL: Multitenant policies are cloned per inheritance subclass.org.eclipse.persistence.internal.helper.DatabaseTable
INTERNAL: Return the new database table associated with this tenant.org.eclipse.persistence.internal.helper.DatabaseTable
getTable
(org.eclipse.persistence.internal.helper.DatabaseTable table) INTERNAL: Return the new database table associated with this tenant.protected String
getTableName
(org.eclipse.persistence.internal.helper.DatabaseTable table, String tenant) INTERNAL: Return the tenant table name.void
initialize
(org.eclipse.persistence.internal.sessions.AbstractSession session) INTERNAL:boolean
INTERNAL:boolean
INTERNAL:void
setShouldUseSharedCache
(boolean shouldUseSharedCache) void
setShouldUseSharedEMF
(boolean shouldUseSharedEMF) protected void
INTERNAL: This method is used to update the table per tenant descriptor with a table per tenant schema.boolean
boolean
protected org.eclipse.persistence.internal.helper.DatabaseTable
updateTable
(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.TablePerMultitenantPolicy
addFieldsToRow, addToTableDefinition, getContextProperty, hasContextTenant, isPrefixPerTable, isSchemaPerTable, isSingleTableMultitenantPolicy, isSuffixPerTable, postInitialize, preInitialize, setContextProperty, setContextTenant, setTablePerTenant, setTenantTableDiscriminatorType, shouldInitialize, usesContextProperty
-
Constructor Details
-
SchemaPerMultitenantPolicy
public SchemaPerMultitenantPolicy() -
SchemaPerMultitenantPolicy
-
-
Method Details
-
initialize
public void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorException INTERNAL:- Specified by:
initialize
in interfaceMultitenantPolicy
- Overrides:
initialize
in classTablePerMultitenantPolicy
- Throws:
DescriptorException
-
clone
Description copied from class:TablePerMultitenantPolicy
INTERNAL: Multitenant policies are cloned per inheritance subclass.- Specified by:
clone
in interfaceMultitenantPolicy
- Overrides:
clone
in classTablePerMultitenantPolicy
-
isSchemaPerMultitenantPolicy
public boolean isSchemaPerMultitenantPolicy()Description copied from class:TablePerMultitenantPolicy
INTERNAL:- Specified by:
isSchemaPerMultitenantPolicy
in interfaceMultitenantPolicy
- Overrides:
isSchemaPerMultitenantPolicy
in classTablePerMultitenantPolicy
-
setTableSchemaPerTenant
protected void setTableSchemaPerTenant()Description copied from class:TablePerMultitenantPolicy
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.- Overrides:
setTableSchemaPerTenant
in classTablePerMultitenantPolicy
-
isTablePerMultitenantPolicy
public boolean isTablePerMultitenantPolicy()Description copied from class:TablePerMultitenantPolicy
INTERNAL:- Specified by:
isTablePerMultitenantPolicy
in interfaceMultitenantPolicy
- Overrides:
isTablePerMultitenantPolicy
in classTablePerMultitenantPolicy
-
getTableName
protected String getTableName(org.eclipse.persistence.internal.helper.DatabaseTable table, String tenant) Description copied from class:TablePerMultitenantPolicy
INTERNAL: Return the tenant table name.- Overrides:
getTableName
in classTablePerMultitenantPolicy
-
getTable
public org.eclipse.persistence.internal.helper.DatabaseTable getTable(org.eclipse.persistence.internal.helper.DatabaseTable table) Description copied from class:TablePerMultitenantPolicy
INTERNAL: Return the new database table associated with this tenant.- Overrides:
getTable
in classTablePerMultitenantPolicy
-
getTable
Description copied from class:TablePerMultitenantPolicy
INTERNAL: Return the new database table associated with this tenant.- Overrides:
getTable
in classTablePerMultitenantPolicy
-
updateTable
protected org.eclipse.persistence.internal.helper.DatabaseTable updateTable(org.eclipse.persistence.internal.helper.DatabaseTable table) Description copied from class:TablePerMultitenantPolicy
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.- Overrides:
updateTable
in classTablePerMultitenantPolicy
-