Mirror views

Mirror views create aliases of a table-view with an optional extension applied to all the columns.

The aliases can be used in different situations. One of the most common is whan a record needs to be connected to more that one record of the same table.

Mirror views are one of the most useful features of CrossModel.

These views create a “mirror” of a table or view, that can be used when a record needs to be connected to more than one record of the same table.

Multiple records connections

For example, we could have a stock item record, that needs to be connected to two different records of tha chart of accounts, one (cost) when it is bought, and one (revenue) when it is sold.

In CrossModel, we can simply create two mirror views of the chart of accounts, and use the first one as the cost accoutn, and the second one as the revenue account.

Mirror views extension

Using the same column names for different tables in a joined view would create an error, and to avoid this every colun should have an alias, that can be created automatically by CrossModel with an extension.

The mirror views can have an extension string, that will be automatically applied to all the columns of the view. In this way, using this view in the program we don’t have to create aliases of the single columns.