Powered by SmartDoc

The jdbc.fragment.length option

A jdbc.fragment.length option specifies a configuration for data access.

Parameters

The jdbc.fragment.length option specifies a column name to store a whole fragment with index mapping.

Artifact

The jdbc.fragment.length option generates no additional classes. The jdbc.fragment.length option just modified the behavior of Relaxer table objects.

The jdbc.fragment.length option adds no additional methods to Relaxer objects.

Example

List 12.16.3.1[fragmentLength.rng] is a sample schema for the jdbc.fragment.length option.

fragmentLength.rng
<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.fragment.length option is as follows:

$ relaxer -jdbc -jdbc.mapping:direct -jdbc.fragment.length:10000 \
    fragmentLength.rng

As a result, Relaxer generates 13 files:

Because the jdbc.fragment.length has the parameter 10000, the length of the data for the column which contains a document fragment will be 10000.

List 12.16.3.2[account.ddl (direct mapping)] is the DDL generated by this command. The column name of a last column is WHOLE.

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(100)
)

If you are using index mapping, this option has no effect to the DDL as shown in List 12.16.3.3[account.ddl (index mapping)].

account.ddl (index 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,
	"document" VARCHAR(8192) NOT NULL
)