diff --git a/forward_engineering/helpers/viewHelper.js b/forward_engineering/helpers/viewHelper.js index 251ddbc5..a074cd11 100644 --- a/forward_engineering/helpers/viewHelper.js +++ b/forward_engineering/helpers/viewHelper.js @@ -11,6 +11,12 @@ const createView = ({ viewData, isActivated, scriptFormat, getViewSelectStatemen const ifNotExist = preSpace(viewData.ifNotExist && 'IF NOT EXISTS'); const { columnList, tableColumns, tables } = viewData.keys.reduce( (result, key) => { + // Keys without an entityName are plain columns that don't reference any table/view column. + // They exist for documentation purposes only and can't take part in the SELECT statement. + if (!key.entityName) { + return result; + } + result.columnList.push({ name: `${getName(viewData.isCaseSensitive, key.alias || key.name)}`, isActivated: key.isActivated, @@ -23,12 +29,10 @@ const createView = ({ viewData, isActivated, scriptFormat, getViewSelectStatemen isActivated: key.isActivated, }); - if (key.entityName) { - const tableName = getFullName(key.dbName, key.entityName); + const tableName = getFullName(key.dbName, key.entityName); - if (!result.tables.includes(tableName)) { - result.tables.push(tableName); - } + if (!result.tables.includes(tableName)) { + result.tables.push(tableName); } return result; diff --git a/package.json b/package.json index 2a38baba..b781a951 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,8 @@ "enabled": true, "viewLevel": "model", "disablePipelines": true, - "includeViews": true + "includeViews": true, + "allowNonReferenceAttributes": true }, "nestedCollections": false, "disablePatternField": true, diff --git a/types/array.json b/types/array.json index d2cc59c3..2fb2c7a4 100644 --- a/types/array.json +++ b/types/array.json @@ -5,7 +5,6 @@ "parentType": "array", "useSample": true, "default": true, - "hiddenOnEntity": "view", "defaultValues": { "properties": [], "primaryKey": false, diff --git a/types/binary.json b/types/binary.json index 2bece65a..66593465 100644 --- a/types/binary.json +++ b/types/binary.json @@ -3,7 +3,6 @@ "erdAbbreviation": "", "dtdAbbreviation": "{BIN}", "parentType": "binary", - "hiddenOnEntity": "view", "useSample": false, "default": true, "defaultValues": { diff --git a/types/boolean.json b/types/boolean.json index c8ea2abe..5db90268 100644 --- a/types/boolean.json +++ b/types/boolean.json @@ -3,7 +3,6 @@ "erdAbbreviation": "", "dtdAbbreviation": "{0/1}", "parentType": "boolean", - "hiddenOnEntity": "view", "sample": true, "useSample": true, "defaultValues": { diff --git a/types/date.json b/types/date.json index e3bfd6d9..7cfeeeeb 100644 --- a/types/date.json +++ b/types/date.json @@ -3,7 +3,6 @@ "erdAbbreviation": "", "dtdAbbreviation": "{dt}", "parentType": "string", - "hiddenOnEntity": "view", "sample": "2018/03/15", "useSample": true, "defaultValues": { diff --git a/types/double.json b/types/double.json index fb11b95f..4f12b531 100644 --- a/types/double.json +++ b/types/double.json @@ -3,7 +3,6 @@ "erdAbbreviation": "", "dtdAbbreviation": "{dbl}", "parentType": "numeric", - "hiddenOnEntity": "view", "sample": 15, "useSample": true, "defaultValues": { diff --git a/types/float.json b/types/float.json index 7a5a0148..65949b98 100644 --- a/types/float.json +++ b/types/float.json @@ -3,7 +3,6 @@ "erdAbbreviation": "", "dtdAbbreviation": "{flt}", "parentType": "numeric", - "hiddenOnEntity": "view", "sample": 15, "useSample": true, "defaultValues": { diff --git a/types/geography.json b/types/geography.json index fc8d83ab..c90e60cd 100644 --- a/types/geography.json +++ b/types/geography.json @@ -3,7 +3,6 @@ "erdAbbreviation": "", "dtdAbbreviation": "{...}", "parentType": "document", - "hiddenOnEntity": "view", "jsonType": { "order": 1, "name": "geography", diff --git a/types/integer.json b/types/integer.json index a5577b7c..697155b9 100644 --- a/types/integer.json +++ b/types/integer.json @@ -3,7 +3,6 @@ "erdAbbreviation": "", "dtdAbbreviation": "{123}", "parentType": "numeric", - "hiddenOnEntity": "view", "sample": 15, "useSample": true, "defaultValues": { diff --git a/types/number.json b/types/number.json index 44f69213..ee926388 100644 --- a/types/number.json +++ b/types/number.json @@ -3,7 +3,6 @@ "erdAbbreviation": "", "dtdAbbreviation": "{123}", "parentType": "numeric", - "hiddenOnEntity": "view", "sample": 15, "useSample": true, "default": true, diff --git a/types/object.json b/types/object.json index 13492b37..6ae9397d 100644 --- a/types/object.json +++ b/types/object.json @@ -4,7 +4,6 @@ "dtdAbbreviation": "{...}", "parentType": "document", "sample": {}, - "hiddenOnEntity": "view", "useSample": true, "default": true, "defaultValues": { diff --git a/types/time.json b/types/time.json index db5dc204..45e2d5e6 100644 --- a/types/time.json +++ b/types/time.json @@ -4,7 +4,6 @@ "dtdAbbreviation": "{tm}", "parentType": "string", "useSample": true, - "hiddenOnEntity": "view", "sample": "08:45:12.123123", "defaultValues": { "primaryKey": false, diff --git a/types/timestamp_ltz.json b/types/timestamp_ltz.json index d6ab139e..c0d39061 100644 --- a/types/timestamp_ltz.json +++ b/types/timestamp_ltz.json @@ -4,7 +4,6 @@ "dtdAbbreviation": "{ts-ltz}", "parentType": "string", "useSample": true, - "hiddenOnEntity": "view", "sample": "2011-02-03 04:05:00 +0000", "defaultValues": { "primaryKey": false, diff --git a/types/timestamp_ntz.json b/types/timestamp_ntz.json index 3c3b3747..4a7f4c32 100644 --- a/types/timestamp_ntz.json +++ b/types/timestamp_ntz.json @@ -4,7 +4,6 @@ "dtdAbbreviation": "{ts-ntz}", "parentType": "string", "useSample": true, - "hiddenOnEntity": "view", "sample": "2011-02-03 04:05:00 +0000", "defaultValues": { "primaryKey": false, diff --git a/types/timestamp_tz.json b/types/timestamp_tz.json index 5147c594..789169ff 100644 --- a/types/timestamp_tz.json +++ b/types/timestamp_tz.json @@ -4,7 +4,6 @@ "dtdAbbreviation": "{ts-tz}", "parentType": "string", "useSample": true, - "hiddenOnEntity": "view", "sample": "2011-02-03 04:05:00 +0000", "defaultValues": { "primaryKey": false, diff --git a/types/varchar.json b/types/varchar.json index 15b8939c..68313160 100644 --- a/types/varchar.json +++ b/types/varchar.json @@ -3,7 +3,6 @@ "erdAbbreviation": "", "dtdAbbreviation": "{vchar}", "parentType": "string", - "hiddenOnEntity": "view", "useSample": true, "default": true, "defaultValues": { diff --git a/types/variant.json b/types/variant.json index 9f92cf39..2e6d0bbb 100644 --- a/types/variant.json +++ b/types/variant.json @@ -4,7 +4,6 @@ "dtdAbbreviation": "{...}", "default": true, "parentType": "document", - "hiddenOnEntity": "view", "jsonType": { "order": 1, "name": "variant",