Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Name

Type

Cardinality

parameter

urn:com.cohga.server.data.database#1.0:parameter

0..n

cache

urn:com.cohga.server.cache#1.0:cache

0..1

fromurn:com.cohga.server.data.database#1.0:from0..n
whereurn:com.cohga.server.data.database#1.0:where0..n
sorturn:com.cohga.server.data.database#1.0:sort0..n
joinurn:com.cohga.server.data.database#1.0:join0..n
optionsurn:com.cohga.server.data.database#1.0:options0..1

Content

None

Notes

  • The cache settings are only used for data source data connections that have a key specified, since it's the key that's used as the cache index
  • If no cache tag is specified then the data will still be cached, but it will use the default cache configuration, to disable caching you need to set disable to true inside the cache definition (see example below).
  • You can completely disable the caching (for all data definitions that don't have cache setting explicitly set) by setting the startup parameter weave.cache.default to true (in startup.cmd, startup.sh and/or weave-service.conf).
  • If no parameters are specified then the server will generate parameters based on the columns in the underlying table, in this case you should also not include any from tags since joins are not currently supported, where tags are ok though.

...

NameTypeRequiredDescription
tablestringyesThe table to join to
onstringyesThe clause used to join the table
typestringnoThe type of join to use
clausestringnoAdditional clauses that can be added to the join

 

...

options

Properties

Name

Type

Required

Description

rpad

number

no

If the key value needs to be padded with spaces on the right to make it match the database this specified the total length of the final padded value.

For example rpad = 10 would change a key value from "value" to "value....." (where each . is a space)

lpad

number

no

If the key value needs to be padded with spaces on the left to make it match the database this specified the total length of the final padded value.

For example lpad = 10 would change a key value from "value" to ".....value" (where each . is a space)

trimbooleannoIf a key value needs to be trimmed of spaces before being used setting this to true will cause that to be done.
maxrowsnumbernoLimit the number of rows that will be extracted from the database when generating the data.
failOnSubstitutionErrorbooleanno

If set to true, or not set at all, this flag will force the generation of the data to fail if there is an issue with performing parameter substitution.

If this is set to false then a where clause that fails parameter substitution will be ignored.

The default value for this flag if it is not set is true.

Sub-tags

None

Content

None


Examples

Code Block
xml
xml
titleBasic data definition where output is based on columns in the underlying table
linenumberstrue
<data:datadefinition id="roadDetails">
	<datasourcedataconnection datasource="datasource.main" table="ROADS" key="RD_NAME" prefix="DISTINCT"/>
</data:datadefinition>

...