...
Name | Type | Cardinality |
---|---|---|
parameter | 0..n | |
cache | 0..1 | |
from | urn:com.cohga.server.data.database#1.0:from | 0..n |
where | urn:com.cohga.server.data.database#1.0:where | 0..n |
sort | urn:com.cohga.server.data.database#1.0:sort | 0..n |
join | urn:com.cohga.server.data.database#1.0:join | 0..n |
...
Name | Type | Required | Description |
---|---|---|---|
clause | string | yes | An additional clause to include in the generated SQL |
uppercase | boolean | no | If the clause uses parameter substitution should the value be converted to upper-case before being substituted |
Sub-tags
None
Content
None
join
Only available in 2.5.11 or later
properties
sort
Properties
Name | Type | Required | Description |
---|---|---|---|
table parameter | string | yes | The table to join to |
on | string | yes | The clause used to join the table |
type | string | no | The type of join to use |
Examples
...
Name of parameter to sort on | |||
direction | string | no | ASC or DESC, ASC is default |
Sub-tags
None
Content
None
join
Only available in 2.5.11 or later
properties
Name | Type | Required | Description |
---|---|---|---|
table | string | yes | The table to join to |
on | string | yes | The clause used to join the table |
type | string | no | The type of join to use |
Examples
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
<data:datadefinition id="roadDetails">
<datasourcedataconnection datasource="datasource.main" table="ROADS" key="RD_NAME" prefix="DISTINCT"/>
</data:datadefinition>
|
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<data:cache id="test">
<setting>value</setting>
<setting>value</setting>
<setting>value</setting>
</data:cache>
<data:datadefinition id="...">
<datasourcedataconnection ...>
...
<cache id="test"/>
</datasourcedataconnection>
</data:datadefinition>
|
Using a temporary table
Code Block | ||||
---|---|---|---|---|
| ||||
</datasourcedataconnection>
</data:datadefinition>
|
Using a temporary table
Code Block | ||||
---|---|---|---|---|
| ||||
<data:datadefinition id="roadDetails">
<datasourcedataconnection datasource="datasource.main" table="ROADS" key="RD_NAME" prefix="DISTINCT" keytable="ROADS_SELECTION" keycolumn="RD_NAME" usercolumn="UID">
<from table="PLANS"/>
<where clause="PLANS.ID=ROADS.PLAN_ID"/>
<parameter name="name" label="Name" column="RD_NAME"/>
<parameter name="suffix" label="Suffix" column="RD_SUFFIX"/>
<parameter name="type" label="Type" column="RD_TYPE"/>
<parameter name="altname" label="Alt. Name" column="ALT_NAME"/>
<parameter name="altsuffix" label="Alt. Suffix" column="ALT_SUFFIX"/>
<parameter name="alttype" label="Alt. Type" column="ALT_TYPE"/>
<parameter type="integer" name="class" label="Class" column="CLASS_CODE"/>
<parameter type="url" name="plan" label="Plan" column="'http://imgsvr:8080/gis/documents/plan_'||PLANS.PLAN_CODE||'.pdf'" text="Open"/>
<cache disable="true"/>
</datasourcedataconnection>
</data:datadefinition> |
This example will utilise a temporary table called ROADS_SELECTION
which contains two columns RD_NAME
who's data type matches the RD_NAME
column in the ROADS
table, and UID
which is a varchar column long enough to contain 32 random characters, and there should be an non-unique index on the UID
column.
Sorting data
You can add <sort> tags to specify what column(s) to sort by by default, e.g.
Code Block |
---|
<data:datadefinition id="roadDetails"> <datasourcedataconnection datasource="datasource.main" table="ROADS" key="RD_NAME" prefix="DISTINCT" keytable="ROADS_SELECTION" keycolumn="RD_NAME" usercolumnprefix="UIDDISTINCT"> <from table="PLANS"/> <where clause="PLANS.ID=ROADS.PLAN_ID"/> <parameter name="name" label="Name" column="RD_NAME"/> <parameter name="suffix" label="Suffix" column="RD_SUFFIX"/> <parameter name="type" label="Type" column="RD_TYPE"/> <parameter name="altname" label="Alt. Name" column="ALT_NAME"/> <parameter name="altsuffix" label="Alt. Suffix" column="ALT_SUFFIX"/> <parameter name="alttype" label="Alt. Type" column="ALT_TYPE"/> <parameter type="integer" name="classaltsuffix" label="ClassAlt. Suffix" column="CLASSALT_CODESUFFIX"/> <parameter type="url" name="planalttype" label="PlanAlt. Type" column="'http://imgsvr:8080/gis/documents/plan_'||PLANS.PLAN_CODE||'.pdf'" text="Open"/> <cache disable="trueALT_TYPE"/> <sort parameter="type"/> <sort parameter="name"/> </datasourcedataconnection> </data:datadefinition> |
...
New Join Syntax
As of Weave 2.5.11 it's possible to specify a table join using join specific tag (rather than having to use from
and where
tags).
...