A jdbc.document.length option specifies a configuration for data access.
The jdbc.document.length option specifies a column name to store a whole document in case of index mapping.
The jdbc.document.length option generates no additional classes. The jdbc.document.length option just modified the behavior of Relaxer table objects.
The jdbc.document.length option adds no additional methods to Relaxer objects.
List 12.14.3.1[documentLength.rng] is a sample schema for the jdbc.document.length option.
<grammar xmlns="http://relaxng.org/ns/structure/1.0" xmlns:sql="http://www.relaxer.org/xmlns/relaxer/sql" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> <start> <ref name="account"/> </start> <define name="account"> <element name="account"> <attribute name="accountNo"> <data type="token"/> </attribute> <element name="balance"> <data type="int"/> </element> <element name="owner"> <data type="token"/> </element> <ref name="address"/> <zeroOrMore> <ref name="phone"/> </zeroOrMore> </element> </define> <define name="address"> <element name="address"> <attribute name="zip"> <data type="token"/> </attribute> <text/> </element> </define> <define name="phone"> <element name="phone"> <attribute name="area"> <data type="token"/> </attribute> <data type="token"/> </element> </define> </grammar>
Execution of Relaxer with the jdbc.document.length option is as follows:
$ relaxer -jdbc -jdbc.mapping:direct -jdbc.document.length:10000 \ documentLength.rng
Because the jdbc.document.length is available
only if the mapping strategy is index
, the
jdbc.mapping option
is used with index
as the parameter.
Because the jdbc.document.length has the parameter 10000
,
the length of the data for the column which contains whole document will be
10000.
As a result of this command, Relaxer generates 13 files:
List 12.14.3.2[account.ddl (index mapping)] is the DDL generated by this command. The data length of the column which contain a document fragment is 100.
CREATE TABLE "account" ( "accountNo" VARCHAR(32) NOT NULL, "balance" INTEGER NOT NULL, "owner" VARCHAR(32) NOT NULL, "address" VARCHAR(128) NOT NULL, "address_zip" VARCHAR(32) NOT NULL, "document" VARCHAR(10000) NOT NULL )
In case you are using direct mapping, this option has no effect on the DDL as shown in List 12.14.3.3[account.ddl (direct mapping)].
CREATE TABLE "account" ( "accountNo" VARCHAR(32) NOT NULL, "balance" INTEGER NOT NULL, "owner" VARCHAR(32) NOT NULL, "address" VARCHAR(128) NOT NULL, "address_zip" VARCHAR(32) NOT NULL, "phone" VARCHAR(512) )