You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
p_audit_column_mappings INVARCHAR2 DEFAULT NULL, -- If not null, the provided comma separated column names are excluded and populated by the API (you don't need a trigger for update_by, update_on...).
125
129
p_audit_user_expression INVARCHAR2 DEFAULT c_audit_user_expression, -- You can overwrite here the expression to determine the user which created or updated the row (see also the parameter docs...).
126
130
p_row_version_column_mapping INVARCHAR2 DEFAULT NULL, -- If not null, the provided column name is excluded and populated by the API with the provided SQL expression (you don't need a trigger to provide a row version identifier).
131
+
p_tenant_column_mapping INVARCHAR2 DEFAULT NULL, -- If not null, the provided column name is hidden inside the API, populated with the provided SQL expression and used as a tenant_id in all relevant API methods.
127
132
p_enable_custom_defaults INBOOLEAN DEFAULT FALSE, -- If true, additional methods are created (mainly for testing and dummy data creation, see full parameter descriptions).
128
133
p_custom_default_values IN XMLTYPE DEFAULT NULL-- Custom values in XML format for the previous option, if the generator provided defaults are not ok.
129
134
);
@@ -174,6 +179,7 @@ FUNCTION compile_api_and_get_code
174
179
p_audit_column_mappings INVARCHAR2 DEFAULT NULL, -- If not null, the provided comma separated column names are excluded and populated by the API (you don't need a trigger for update_by, update_on...).
175
180
p_audit_user_expression INVARCHAR2 DEFAULT c_audit_user_expression, -- You can overwrite here the expression to determine the user which created or updated the row (see also the parameter docs...).
176
181
p_row_version_column_mapping INVARCHAR2 DEFAULT NULL, -- If not null, the provided column name is excluded and populated by the API with the provided SQL expression (you don't need a trigger to provide a row version identifier).
182
+
p_tenant_column_mapping INVARCHAR2 DEFAULT NULL, -- If not null, the provided column name is hidden inside the API, populated with the provided SQL expression and used as a tenant_id in all relevant API methods.
177
183
p_enable_custom_defaults INBOOLEAN DEFAULT FALSE, -- If true, additional methods are created (mainly for testing and dummy data creation, see full parameter descriptions).
178
184
p_custom_default_values IN XMLTYPE DEFAULT NULL-- Custom values in XML format for the previous option, if the generator provided defaults are not ok.
179
185
) RETURN CLOB;
@@ -226,6 +232,7 @@ FUNCTION get_code
226
232
p_audit_column_mappings INVARCHAR2 DEFAULT NULL, -- If not null, the provided comma separated column names are excluded and populated by the API (you don't need a trigger for update_by, update_on...).
227
233
p_audit_user_expression INVARCHAR2 DEFAULT c_audit_user_expression, -- You can overwrite here the expression to determine the user which created or updated the row (see also the parameter docs...).
228
234
p_row_version_column_mapping INVARCHAR2 DEFAULT NULL, -- If not null, the provided column name is excluded and populated by the API with the provided SQL expression (you don't need a trigger to provide a row version identifier).
235
+
p_tenant_column_mapping INVARCHAR2 DEFAULT NULL, -- If not null, the provided column name is hidden inside the API, populated with the provided SQL expression and used as a tenant_id in all relevant API methods.
229
236
p_enable_custom_defaults INBOOLEAN DEFAULT FALSE, -- If true, additional methods are created (mainly for testing and dummy data creation, see full parameter descriptions).
230
237
p_custom_default_values IN XMLTYPE DEFAULT NULL-- Custom values in XML format for the previous option, if the generator provided defaults are not ok.
Copy file name to clipboardExpand all lines: docs/changelog.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,6 +43,7 @@ Please use for all comments, discussions, feature requests or bug reports the Gi
43
43
- added: double quoting of table and column names can now be configured (parameter p_double_quote_names, default true)
44
44
- added: update function with return clause (mainly for use in create_or_update_row to prevent read row after update)
45
45
- added: unit tests with utPLSQL (it will be a permanent task to improve the tests with every new feature or bugfix)
46
+
- removed: support for database versions < 12.1 - if this is a problem for you then use the generator version 0.5.2 (without all the new features, sorry...)
46
47
- removed: support for a generic change log (parameter p_enable_generic_change_log - makes no sense anymore with bulk processing and multi column primary keys)
47
48
- removed: prevent updates if columns do not differ (remove was needed to support all possible column types and for performance reasons)
48
49
- removed: parameter p_reuse_existing_api_params (usage was was not logic, simply provide always your needed parameters and create scripts or a wrapper)
- Supports column prefix placeholders to be able to reuse the same mappings in multiple tables with different column_prefixes
224
225
- Example with a global version sequence: `#PREFIX#_VERSION_ID=tag_global_version_sequence.nextval`
225
226
227
+
## p_tenant_column_mapping (since v0.6.0)
228
+
- String (varchar2), default: null
229
+
- If not null, the provided column name is excluded from the parameters and appended to all primary key where clauses with the provided SQL expression
230
+
- If you have unique keys in your tables you should make sure the tenant column is part of it, otherwise the unique key based read_row methods are not filtering correct
231
+
- For the ref cursor based bulk fetch method `read_rows` the API cannot do anything for you, because the ref cursor is defined outside the API - you need to make sure that all view provided to the users are secured correct with an appropriate where clause - the generated DML and 1:1 views do this also
232
+
- You should consider to hide your column from standard `select *` queries: Also see [Invisible Columns in Oracle Database 12c Release 1 (12.1)](https://oracle-base.com/articles/12c/invisible-columns-12cr1)
233
+
- Supports column prefix placeholders to be able to reuse the same mappings in multiple tables with different column_prefixes
0 commit comments