Create a Business Object Based on a DB Table or View

To create business objects based on tables and views in your DB schema, you switch your visual application's database schema, then use the Create Business Object wizard to create a business object based on an existing table or view.

Before you begin:
  • Your Visual Builder instance must be configured to use another Oracle DB and the schema must already exist in the tenant DB. Talk to your administrator to confirm this setup.
  • Your visual application must not have any business objects defined.

To create a business object based on an existing table or view:

  1. From the visual application’s menu, choose Settings, then click the Business Objects tab.
  2. From the Schema Selection list, select your schema.


    The list of schemas available to you is defined by your administrator in the Tenant Settings of your Visual Builder instance. If a particular schema isn't listed, talk to your administrator to add it as an available schema for your instance.

    Note:

    Details of the tables and views available for use in a schema are fetched once and cached. If the schema (or tables/views within it) was changed, click Refresh to pick up the latest updates for a particular schema. You can also do this when creating a table or view for a schema during development.
  3. Optional: To simplify the task of changing schemas when your app is deployed to different environments like development, test, or production, you can add additional available schemas and associate them with different application profiles (see Switch Schemas Used During an App's Lifecycle). If you don't add additional schemas, the schema you selected in the previous step is used as the default schema for all deployments.
  4. Click Business Objects in the Navigator, then click + and select Business Object from Table.
  5. In the Create Business Object wizard, select a table or view.
  6. Look over the table and column data that displays based on your selection.

    The Business Object Name and Display Label fields under General are populated based on your table's name and can be edited. If you selected a view or if the primary key cannot be identified for some reason, select the field that should be the primary key in the Select Primary Key field. The primary key does not have to be numeric, but it must be a column that contains unique data and no NULL values.

    A list of Fields on the right shows the table's columns that you can add as fields to your business object. A check mark in the first column indicates the column's fields that will be added.
    Description of byos-create-bo-fields.png follows
    Description of the illustration byos-create-bo-fields.png

    This Fields list does not include unsupported data type columns or foreign key columns that link to tables that don't yet have a business object; for example, the DEPARTMENT_ID column in the image can't be added as a field because a business object based on the referenced DEPARTMENT table doesn't exist yet.

    The Field Name and Display Label are based on the table's column name. If you want to change the default values, double-click the field or click Edit icon in the row and make changes. You can also update the Required property. If you don't want a particular column to be included as a field, deselect the check mark in the first column, or deselect Include Field when the row is in edit mode:
    Description of byos-create-bo-select-fields.png follows
    Description of the illustration byos-create-bo-select-fields.png

  7. Click Create.

    A business object created based on your schema shows in the Business Objects tab. You can add new fields to this object (including calculated fields) based on the existing table/view and modify existing fields. If a field's metadata is not compatible with the table/view column properties, you'll see validation messages, similar to those for native business objects. For example, when a field is based on a VARCHAR2(20) column but the Maximum Length property is set to a higher value, you'll see a warning around the property and in the Audits pane:
    Description of byos-validation-message.png follows
    Description of the illustration byos-validation-message.png

    You can also set up business rules, security, and call REST API endpoints from components. In general, you manage these business objects similar to how you'd manage a native business object, but because you cannot use the Business Objects editor to make changes that would (in native business objects) update the schema, some options in the editor won't be available for objects based on existing DB tables or views:
    Option in Business Objects Editor Native Business Object Business Object Based on Own Schema
    New Relationship (+) button in Overview tab X
    Contains Application Setup Data property in Overview tab X
    Unique and Indexed fields in Properties pane X
    Convert an existing field to a calculated field: Calculate value with a formula and Aggregate from related object data fields in Properties Pane X
    Change cardinality, target business object, or Delete Rule in the Relationship editor X
    Data Manager in the Business Objects pane's Options menu X
    Import From File and Export CSV options in Data tab X