Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
EclipseLink/DesignDocs/Extensibility
UNDER CONSTRUCTION
Contents
Extensibility
The goal of this feature is to allow a user to start with a predesigned persistence unit and extend the entities in that persistence units with new mappings at runtime.
For example, a simple application is provided that defines a Customer entity that maps "name" and "customer number". As the application is running, the Customer application can be extended to include a "company name" mapping.
In the above example, the addition of the "company name" is acheived only through interaction with EclipseLink. EclipseLink should handle schema modifications (if any) and any adjustment to EclipseLink metadata and Session.
Schema Design for Extensibility
The following are some data-model extensibility options
Flex Columns
Schema is designed to include preallocated columns that can be used to map additional data.
e.g. Customer table has colums NAME, CUST_NUMB, DATA1, DATA2 etc. "company name" is mapped to DATA1.
Custom Columns
EclipseLink alters tables as needed.
e.g. Customer table has colums NAME, CUST_NUMB. When "company name" is added to Customer, a COMPANY_NAME column is added to the table by EclipseLink using an ALTER TABLE call.
Value Rows
Extra data is stored in a Map structure.
e.g. Customer table has colums NAME, CUST_NUMB. A table exists with columns ATTR_NAME, ATTR_VALUE, OWNER_ID, OWNING_ENTITY. That column holds the names of any new attributes, their values, a foreign key to the owner, and a way of determining which Entity the mapping belongs to.
Metadata =
Metadata Storable
DB table store metadata for extended fields. It is accessed at login time, prior to descriptor initialization.
Metadata access
Metadata is accessible through an Interface. (user defined?)
Multi-tenancy discussion
The following multi-tenancy discussion doc was used in the discussion of this feature
Multi Tenant Features: Description of features available and being considered for Multi Tenant APPs