Working with a database based collection includes adding properties or object as well as removing and delete objects from a collection or database.
All important procedures for managing database-based collections are described below:
To add a proxy property to a database based collection
Proxy properties allow transparent use of database columns (base property) with modified metadata. Metadata includes:
-
Name
-
Description
-
Specifying a property as mandatory or optional
-
Structure for displaying the property value
-
Component selection for displaying and editing property values
You can modify a property within a component to match the requirements of the component exactly using proxy properties. Ensure the database of a proxy property is always the base property value. Updating the value through proxy properties always have additional effects on the base property.
-
Right-click to select a collection.
-
Select the Proxy property option.
A proxy property is added under the selected collection node.
-
In Node editor, select a property in the Base property menu.
-
In the Identifier field, enter the name for the proxy property.
To add more proxy properties to a database based collection
-
Right-click to select a collection.
-
Select the Property option.
-
Enter at least a name and data type for this property.
NOTE: Each object, which is in the collection at runtime, now has an additional property. You can handle this like a database based property, for example, to store temporary data.
To add a new object to a collection
-
Right-click to select an action node.
This could be the Initializer node of the component, for example.
-
Select Paste and click the new node.
-
In the Node editor view, select the required collection under Collection.
-
Using the Filter condition property, enter an filter condition expression if you wish.
NOTE: Ensure the object is only added in the collection.
To modify a property in a database-based collection
In the steps below, the display value in Entry date in the Address Book is modified from <dd.MM.yy> to <yyyy-MM-dd>, as an example.
NOTE: The steps for this function can be used for the Child relation column and Foreign key relation column. For more information about these functions, see the One Identity Manager Web Designer Object Model Documentation.
-
Log in to the Web Portal with your user information and select the Address Book view.
-
Select the additional Entry date column, if it is not displayed, and look at the current display value.
In our example, we presume that the <MM/DD/YY> display value is set.
-
In the Address Book view, click the title and switch to the Web Designer.
-
Open the Properties view and click to switch to the definition object in the definition tree view.
-
Open the Collections node using and mark the Person data object.
-
In the context menu, select the Object in extension | Modify property item.
The display in the definition tree view switches to Configuration (custom).
-
In the node editor view, in the Base property menu, select the EntryDate field and enter the new expression for the display value in the Expression for display values field.
In our example, the following expression could be used.
FormatDate(EntryDate, "yyyy-MM-dd")
-
Switch to preview mode and re-compile the web application.
-
Select the Address Book view and the additional Entry date column.
In Entry date, the display value is yyyy-MM-dd.
To remove objects from the collection or delete them from the database
-
Right-click to select an action node.
This could be the Initializer node of the component, for example.
-
Click Delete and select the new node.
-
In the Node editor view, select the required collection under Collection.
- Perform one of the following tasks:
-
Delete row only from collection under Delete type if you want to delete the object from the collection.
-
Under Delete type, select the Delete database object and save option.
-
Using the Filter condition property, enter an filter condition expression if you wish.
To save objects in the database
-
Right-click to select an action node.
This could be the Initializer node of the component, for example.
-
Select the Save and click action and click the new node.
-
In the Node editor view, select the required collection under Collection.
-
Using the Filter condition property, enter an filter condition expression if you wish.
Data is linked in a database by relations to each other. You can use these relations to load data from the database in the simplest way.
Prerequisite for using such a collection is a collection containing source data.
There are different type of relations for defining a collection:
- Defining with a foreign key relation:
A foreign key relation helps automatically load those objects in a database view that were referenced by objects from another collection through a foreign key relation.
- Defining with child relation:
A child relation helps automatically load those objects in a database view that reference objects from another collection through a child relation.
To define a collection with a foreign key relation
- Open the module or component to which to add the collection.
- Select the Collections node by right-clicking on it.
- Select the Database view by foreign key relation menu item.
- In Source data collection, select the collection with the source data.
- In Foreign key column, select the foreign key column to create the relation to the target table.
- Enter the name for the new collection in Identifier.
You do not have to trigger loading for this type of collection. The moment the data is available in the source data collection, the foreign key referenced objects are automatically loaded.
To define a collection with a child relation
- Open the module or component to which to add the collection.
- Select the Collections node by right-clicking on it.
- Select the Database view by child relation option menu item.
- In Object type, select the database table from which to load the objects.
- In Source data collection, select the collection containing the objects to be referenced.
- In Child relation column, select the foreign key column to create the relation to the target table.
- Enter the name for the new collection in Identifier.
You do not have to trigger loading for this type of collection. The moment the data is available in the source data collection, the referenced objects are automatically loaded.
For different use cases, it is necessary to examine database objects from multiple tables together. The special collection type Database objects from multiple tables in the object model is available for this.
To define a collection with the option "Database objects from multiple tables"
- Open the module or component to which to add the collection.
- Select the Collections node by right-clicking on it.
- Select the Database objects from multiple tables menu item.
- Enter the name for the new collection in Identifier.
A collection like this is database based, but can accept objects from multiple database tables.
For more information, see "Database objects" as a collection. You must explicitly provide the database table from which the objects will be loaded.
NOTE: You can use the database query wizard in a module or component of a collection or when you want to add a new module or component.
You cannot execute SQL expressions directly in Web Designer for security reasons. Instead, this wizard helps you create SQL expressions that are stored in QBMLimitedSQL and linked to at least one permissions group in QBMGroupHasLimitedSQL. Your own collection node is added for the query.
To create a database query
- Perform one of the following tasks:
- In the navigation view, select a module or a component.
- Create a new module or component.
- In the definition tree view, mark the Collections node in the Object definition view and, in the context menu, select the Wizards | Database query wizard or the Object in extension | Wizards | Database query wizard menu item.
NOTE: The navigation depends on whether you have selected a custom module/component or a default module/component. Default database objects first require an object extension. For more information, see Extensions.
Wizard for creating or selecting a database query is displayed for a SQL expression to be entered or selected.
- Select the New option.
This displays the following fields:
Table 57: SQL expression settings
Collection name |
If necessary, overwrite the standard name for the collection that you are adding with this query. |
Identifier |
In this field, enter a unique identifier that is used later to identify the entry. |
SQL expression |
In this field, enter the entire expression. You can also declare parameters. |
Description |
In this field, enter an explanation of this expression. This makes it easier for other users to understand and classify this expression. |
- Modify the settings, then click Next.
Specify the dialog groups that can execute the SQL snippet in Wizard for creating or selecting a database query. All dialog groups are selected.
- Specify the relevant dialog groups.
- Disable the relevant dialog groups by double-clicking .
- Disable Select all / deselect all to deselect all listed dialog groups and to enable the relevant dialog groups one by one.
- Enable the relevant dialog groups by double-clicking .
- Specify the parameters you wish to select and set the values in the following Wizard for creating or selecting a database query page.
- If necessary, disable parameter columns you do not want to include in the query or that were recognized by the parser as parameters but are not correct.
- Disable Select all / deselect all to select all parameter columns individually.
- To enter a value for the parameter, click next to the required parameter column.
NOTE: You can check your database query with Test statement. As soon as the database processes running in the background are complete, you can test the new expressions.
This display the Processing page and generates the new collection and SQL expression.
- Click Finish.
To select a database query
- Perform one of the following tasks:
- In the navigation view, select a module or a component.
- Create a new module or component.
- In the definition tree view, mark the Collections node in the Object definition view and, in the context menu, select the Wizards | Database query wizard or the Object in extension | Wizards | Database query wizard menu item.
NOTE: The navigation depends on whether you have selected a custom module/component or a default module/component. Default database objects first require an object extension. For more information, see Extensions.
The Wizard for creating or selecting a database query page is displayed and you can enter or select a SQL expression.
- Select the Existing option.
This displays the following input and text fields.
Table 58: Settings for an existing SQL expression
Collection name |
If necessary, overwrite the standard name for the collection that you are adding with this query. |
SQL snippet |
Select an existing fragment that you can use and modify in the SQL expression field. |
SQL expression |
In this text field, modify the selected snippet and the preset parameters if required. |
- Modify the settings, then click Next.
Specify the dialog groups that can execute the SQL snippet in the following Wizard for creating or selecting a database query page.
- Specify the relevant dialog groups.
- Specify the parameters you wish to select and set the values in the following Wizard for creating or selecting a database query page.
- If necessary, disable parameter columns you do not want to include in the query or that were recognized by the parser as parameters but are not correct.
- Disable Select all / deselect all to select all parameter columns individually.
- To enter a value for the parameter, click next to the required parameter column.
NOTE: You can check your database query with Test statement. As soon as the database processes running in the background are complete, you can test the new expressions.
This display the Processing page and generates the new collection and SQL expression.
- Click Finish.