Skip to Content

Table Inheritance

New in Vinyl 2.7, there is a Table Inheritance feature available for use from the Data Storage Layer. Table Inheritance allows you to not require using the Vinyl Connector if everything you are connecting to is local. To use this feature, you will click on the Edge Case button available from the Table you wish to Extend from, when working in the Data Layer. This is where you configure and define this feature for use. The Extends field, available when configuring, displays a list of all public data objects that are available on the server environment.

Inheritance essentially instructs Vinyl to inherit a copy of all of the Columns and data records the selected Table has available to it from the existing Data Source. The data records still resides in the table's Data Source location that you Inherit from. The assumption is that you would Inherit a Table and then append new unique Column(s) onto it as needed.

The local table that gets created when using Inheritance stores any Primary Keys along with any newly added Columns. The newly created table will also inherit any validations, logic, and/or Events from the source table selected. You can use the newly created Inherited table to add Business Logic onto or against it.

By design, Vinyl will not automatically reflect changes made to the source or master table in the Inherited table. See "To Capture Changes from Inherited Table" to address this situation.

Note

Once Table Inheritance is defined for a given table, that value cannot be modified after it has been saved.

Extendtable

To Configure Table Inheritance

Table Inheritance is available from the Data Layer. The steps outlined here assume that you wish to Extend a table into the same data source, the option to Extend a table into a different data source are outlined in the Example Usage section below.

  1. Navigate to the App Workbench
  2. Locate the existing Table you wish to Extend, click the Design button. For example: Customer
  3. Click the Edge Case button
  4. Click the Extend button
  5. Leave the Extends value as is, this represents the named table being extended. For example: Customer
  6. Assign a unique Name for the new Table. For example: CustomerExtend
  7. Click Save
  8. Vinyl brings in all inherited Columns into the Columns panel
  9. Click Create and add any new Columns required

To Capture Changes from Inherited Table

By design, Table Inheritance will not automatically bring in Column changes made to the selected source or master table you are inheriting from. If you want to capture changes from the source table, you can use the Import button available from the Data Layer.

  1. Navigate to the App Workbench
  2. Locate the existing Table you wish to update, click the Design button. For example: CustomerExtend
  3. Click the Edge Case button
  4. Click the Import button
  5. Vinyl will prompt to ask "Import changes into current table?", click Proceed
  6. Vinyl will prompt after importing the changes, and any Column updates will be visible from the Columns panel. For example: Successful!

Example Usage

The following example describes one scenario where you might use Table Inheritance, in this scenario you want to extend a table from one data source to another data source. One example where you might use Table Inheritance is if you wanted to build a User Parameter table off of a Public Data Object in one data source that you Extend into a different data source. With this scenario we'll outline the basic steps you would take to get started:

  1. Navigate to the App Workbench, Business Layer and confirm that App Data Sources has the data source selected where you want the Extended table to reside. For example: Northwinds
  2. Open the record for any of the existing Tables in this data source
  3. Click the Edge Case button
  4. Click the Extend button
  5. Select the Table you want to Extend from the Extends drop down menu. For example: Se_User from the Vinyl data source
  6. Confirm the Name value is what you want the extended table to be Named. For example: Se_User_Extension
  7. Click Save
  8. Click on Edge Case and confirm the extension table has CRUD Support checked or enabled for Insertable, Updatable, Deletable
  9. Create a new Boolean column on extension table. For example: BooleanTest

    Booleantest

  10. Create a Crud Rule to update all records for the boolean value to 1. Make sure to enable Business Layer on the CRUD Rule Purpose settings.

    Crud Boolean

  11. Click the Edge Case button and check to enable Business Layer

  12. Click Save
  13. Click the x to exit out of the screen

    Crud Logic

  14. Confirm Crud Rule Results show all existing User Accounts with boolean field marked as 1

  15. Click the Execute button to execute the CRUD Rule
  16. Navigate to the Data Storage Layer, to the table you extended and confirm that the Boolean column now reads 1 for all User Accounts