A component table is a software construct coded in Java or .NET, but made available to USoft Definer as if it were a database table.
In a USoft solution, component tables let you perform online transactions on heterogenous data from various sources. You can define USoft rules against component tables in much the same way as against database tables.
USoft also delivers generated, paintable UIs for component tables in the same way as for standard database tables. Component tables are first-class citizens in USoft Definer: they can be used in relationships, batch jobs and object shopping.
The difference between a database table and a component table is that for a component table, the data is not stored in the database, but it is retrieved using external USoft Connector components. The Rules Engine translates the functionality of these USoft Connector components to SQL. RDMI technology is used to connect to the external USoft connector components.
To create a component table:
|1.||On the Catalog's Model and Rules Tab page, double-click on Tables.|
|The Tables wizard appears.|
|2.||Enter the requested information in each of the wizard's dialogs.|
|Do NOT physically create the table in the database.|
|Once the table has been created, you can refine both the table and its columns if required, by double clicking on the table name in the Catalog. You can use the What's This? help in the Tables window for help on each field.|
|3.||Depending upon the type of component you want, on the Catalog's Model and Rules Tab page, open the Components item, and double-click Automation Server or J2EE component.|
|4.||Specify the name of the component, and optionally specify an internal Prog ID. Do NOT specify any of the component methods.|
|5.||On the State tab page, select the Stateful Component check box. Specify whether the lifetime of the component should be Session or transaction.|
|6.||On the State tab page, select the Support Table Component checkbox. Check the UPDATE, INSERT, and DELETE checkboxes. Also check the Participate in Transaction, COMMIT, PRECOMMIT and ROLLBACK checkboxes.|
|7.||You must now connect the table to the component. On the Catalog's Model and Rules Tab page, double-click the name of the table you created earlier. The Tables info window appears.|
|8.||Check the Component Table check box. This specifies that the table is linked to an external component which can act as a database table.|
|NOTE: The name of the component must always be the same as the name of the table.|
|USoft automatically adds the definitions of the following methods to the component:|
|9.||Create the connector component code using DCOM for example, or find a predefined component. You must include code for each of the methods defined in the previous step. Make sure that when you create these methods, you use their parameters in the same order as they are defined in the Definer.|
|NOTE: If you use COM, the parameters that can have a NULL value must be defined as VARIANT. This is, for example, the case with the parameters of the QueryExe method.|
To add a constructor to a component:
|1.||Depending upon the type of component you are working with, on the Project Catalog's Model and Rules Tab, open the Components folder, then the 'Automation Servers' or 'J2EE Components' folder. Double-click the required component. In the resulting info window, click the Constructor tab page.|
|2.||In the Constructor SQL field, specify the SQL statement (SELECT or INVOKE) that must be executed when the component is created. The result of this statement should contain the parameters for the constructor of the component.|
|3.||Press the Check button. If the SQL is correct, the 'correct' checkbox will be automatically checked.|
Component tables can be accessed as if they were normal database tables. In all the places within USoft where you can specify a SQL statement you can use component tables. Component tables are allowed in all subqueries (i.e. NOT EXISTS, NOT IN etc). SELECT statements, as well as manipulations, are allowed on component tables, with the following restrictions:
•There is no outer-join support.
•CONNECT BY and START WITH are not allowed.
•At the moment, component tables cannot be subtypes or super type tables.
•Primary key columns of Component Tables are non-updatable. The reason for this is, that it makes the definition of the UpdateRow method easier: it gets parameters for every column. Without the restriction, the old values for the primary key must also be passed to the method.
•Binary data is not supported.
•The STDDEV and VARIANCE functions are not supported for queries on component tables.
Rules-Driven Method Invocation (RDMI)