Importing Database Tables or Views With the DB Import Utility

The DB Import utility allows you to connect to a database and import schemas.

You select the tables and views to import and the utility adds corresponding TIBCO BusinessEvents database concept definitions to the project. By default the utility names the database concepts using the table or view name. You can, however, provide different names as desired.

The utility provides an option to create one event for each table or view. The generated event’s payload corresponds to the schema of the concept created for that table or view. These events can then be used when you perform database operations using provided functions, such as queryUsingPrimaryKeys().

See Table Constraints and Concept Relationships to understand how table constraints affect concept relationships.

Note: Add the be.dbconcepts.dburi.query.reuserefs property, under the processing unit property group of the project CDD, to avoid duplicate Database concepts when two parents links to same row. When property is set to the value "true", and a query is made, then the BusinessEvents checks if the queried concept is already in cache. If the concept is already present in the cache, then the that concept is used instead of creating a new concept.

Prerequisites

Refer to Prerequisites for Importing Database Tables or Views for details configuration or setup required before importing the database tables or views.

Procedure

  1. Go to File > Import > TIBCO BusinessEvents > Database Concepts.

    The DB Import wizard displays, showing the Specify Database Connection dialog.

  2. In the JDBC Resource URI field, click the Browse button and select the JDBC Resource URI for the database connection you added in Task .

    The database connection details from the JDBC resource display.

  3. In the User SQL Query field, type a query that returns the schema name and the table name that you want to import.
    Note: The User SQL Query field appears only if dbimport.use.sql is set to true in studio.tra. For more details, see Importing Selected Database Tables .
  4. If needed, you can override the database connection details. Click Next.

    You see the Project Resource Location dialog.

  5. In the Concept Folder field, browse to and select the project folder that will contain the folder of database concepts.
    Note:

    The same folder name is used for concepts and for events. For example, if you are using a schema called HR, then HR is used as the project folder name containing the database concepts—and it is also the folder name used for their corresponding events.

    If you specify the same parent folder for the database concepts and for the corresponding events, then the event and concept definitions are stored in the same folder.

  6. (Optional) Check the Generate Events checkbox if you want to create a simple event for each imported concept. When you check the Generate Events checkbox, additional fields appear for you to specify details for the events.
    • In the Events Folder field, browse to and select or create the project folder for the events.
    • In the Event Destination URI field, click the Browse button and select the default destination for the events.
  7. Click Next.

    You see the Select Database Entities dialog.

  8. Select the database entities (tables or views) from which you want to create database concepts (and events if you selected that option).
  9. Select the Generate Concept Relationships checkbox if you want to create relationships between concepts based on database constraints. See Table Constraints and Concept Relationships for more details about relationships.

    The utility imports any additional database entities that were not in the original selection but that must be imported because they have a relationship to the selected subset of entities.

    If this is the case, the message "N other related entities would be imported in addition to selected entities" displays.
  10. Click OK to import the selected entities along with their related entities, and click Next.
  11. At the Concept Name For Database Entity dialog, database schema names are provided as default names of the TIBCO BusinessEvents concepts.
  12. Edit the TIBCO BusinessEvents concept names as desired, then click Finish.

Result

The utility creates the concepts (and events if you chose that option). Browse your project tree to verify that the expected concepts and events have been created.

See Importing Domain Model Information for a Database Concept if you want to import domain model entries for a property in the database concept.