Specifying Field Names
TIBCO Patterns closely follows the SQL conventions for handling field names in joined searches.
| • | The table name precedes the field name and is separated by a period. Note that, as TIBCO Patterns allows blanks in both table names and field names, no blank separators are allowed on either side of the period. |
| • | A table name qualifier is only required when the field name is not unique across the set of tables in the joined search. |
| • | As in SQL, an alias can be assigned for a child table. However, unlike SQL, an alias name cannot be assigned to the parent table in a joined search. When an alias name is assigned, it must be used instead of the actual table name in all the field names for that query. |
Modifying the example to include aliases for the child tables the SQL query is:
|
TIBCO Patterns Java API:
NetricsJoin join_def = new NetricsJoin(“Persons”, |
There are some restrictions on alias names.
| • | All alias names must be unique. |
Invalid Example
NetricsJoin join_def = new NetricsJoin(“Persons”, |
| • | An alias name cannot be the same as a table in a different position. |
Invalid Example
NetricsJoin join_def = new NetricsJoin(“Persons”, |
Invalid Example
NetricsJoin join_def = new NetricsJoin(“Persons”, |
Valid Example
NetricsJoin join_def = new NetricsJoin(“Persons”, |
| • | Alias names must be used when the same child table appears multiple times in the child tables list. Each child table must have a unique identifier. If the same table is used multiple times it must be assigned different alias names. |
The special parent key field name
A special field name: “^parent”, that is, the special character caret (Unicode code point 5E) followed by the word “parent”, is used to refer to the parent record key value of a child record. This special field name is used only for joined searches. As this special field exists for each child record it must always be qualified with a table (or alias) name when more than one child table is specified in the search. This special field is treated as having a field type of non-searchable text. Therefore, it can’t be used in simple or cognate searches. It can be used in predicate expressions, in both filtering predicates or query predicates.