In this section you can find information about advanced settings for generation of Java files.
One XML file is generated for every table from DOML file (situated in table folder with other java and sql files). That XML file is used as a base for generating four Java files.
DTD for that file can be found in <dods_home>/dtd/temporaryXML.dtd file. Some tags could be changed, i.e. <AUTHOR>.
Important: some tags should not be changed, or otherwise generated code will not be compailable.
The hierarchy of tags in a XML file is, as follows:
<TABLE>
<PACKAGE/>
<AUTHOR/>
<PROJECT_NAME/>
<TABLE_NAME/>
<CLASS_NAME/>
<DB_VENDOR/>
<TEMPLATE_SET/>
<COLUMN>
<REFERENCE_OBJECT>
<CONSTRAINT/>
<IS_ABSTRACT/>
<IS_FOREIGN_KEY/>
<TABLE_NAME/>
<PACKAGE/>
</REFERENCE_OBJECT>
<IS_CONSTANT/>
<JAVADOC/>
<DB_TYPE/>
<JAVA_TYPE/>
<JAVA_DEFAULT_VALUE/>
<USED_FOR_QUERY/>
<CAN_BE_NULL/>
<IS_PRIMARY_KEY/>
<SIZE/>
<GENERATE_SECURE/>
<GENERATE_INSECURE/>
</COLUMN>
<REFERRER>
<REFATTR/>
</REFERRER>
<INDEX>
<INDEX_COLUMN/>
</INDEX>
<DO_IS_OID_BASED/>
<IS_ABSTRACT/>
<DELETE_CASCADES/>
<DO_IS_MULTIDB_BASED/>
<IS_ANY_COLUMN_SECURE/>
<GENERATE_DIRTY/>
<GENERATE_SECURE/>
<GENERATE_INSECURE/>
<MASS_UPDATES/>
<MASS_DELETES/>
</TABLE>
This section contains an alphabetical reference of all the XML tags that DODS can generate using given DOML file. Every tag contains the subsections:
Content - tags that the tag can contain.
Attributes - attributes the tag can have.
Context - tags within which the tag can appear, in other words, the tags that can contain it.
Can column be null. Possible values for can_be_null are: true and false.
Content:None
Attributes: None
Context: <column>
The name of the class which represents table in the database, mostly, it is the TABLE_NAME.
Content: None
Attributes: None
Context: <table>
Represents one column in the table.
Content: <REFERENCE_OBJECT>, <IS_CONSTANT>, <JAVADOC>, <DB_TYPE>, <JAVA_TYPE>, <JAVA_DEFAULT_VALUE>, <USED_FOR_QUERY>, <CAN_BE_NULL>, <IS_PRIMARY_KEY>, <SIZE>, <GENERATE_SECURE>, <GENERATE_INSECURE>
Attributes:
1. name - Name of the column in the table.
Context:<table>
Specifies whether the specified table row must exist. Possible values for constraint are: true and false.
Content: None
Attributes: None
Context: <reference_object>
Data type from database that represents column.
Content: None
Attributes: None
Context: <column>
The database type. Possible values are Standard, InstantDB, Oracle, Informix, MySQL, Sybase, PostgreSQL, MSQL, DB2, QED or HypersonicSQL.
Content: None
Attributes: None
Context: <table>
This is value retrieved from the configuration file and is used for sql code generation.
Content: None
Attributes: None
Context: <table>
Contains information about generation code for multi database support. Possible values: true and false.
Content: None
Attributes: None
Context: <table>
Is table based on OID keys. Posible values for do_is_oid_based are: true and false.
Content: None
Attributes: None
Context: <table>
Specifies whether 'dirty' methods are to be generated ("Compatible") - as before, deprecated ("Depricate"), or not generated at all ("Omit").
Content: None
Attributes: None
Context: <table>
True if secure methods should be generated, otherwisw false.
Content: None
Attributes: None
Context: <table>
True if insecure methods should be generated, otherwise false.
Content: None
Attributes: None
Context: <table>
Represents table index.
Content: <index_column>
Attributes:
1. id - Id of index.
2. unique - True if index is unique, otherwise false.
3. clustered - True if index is clustered, otherwise false.
Context: <table>
Identifies index column.
Content: None
Attributes:
1. id - Id of index column, same as name of column.
Context: <index>
Is generated class abstract. Possible values for is_abstract are: true and false.
Content: None
Attributes: None
Context: <table>, <reference_object>
It is true if for any table column are generated secure methods, otherwise, is false.
Content: None
Attributes: None
Context: <table>
Does column have constant value, that is, does it represent constant class attribute (not taken from database). Possible values for is_constant are: true and false.
Content: None
Attributes: None
Context: <column>
Is column used as a foreign key. Currently is_foreign_key tag has only one value: false.
Content: None
Attributes: None
Context: <reference_object>
Is column a primary key. Possible values for is_primary_key are: true and false.
Content: None
Attributes: None
Context: <column>
Data type from Java that represents column.
Content: None
Attributes: None
Context: <column>
Package that contains Java files.
Content: None
Attributes: None
Context: <table>, <reference_object>
Tag that is used like attribute for tag <referrer>. It represents column of table that references generated class.
Content: None
Attributes:
1. name - Name of the column that references some DO objects. It is object of generated class, mostly.
2. do_name - Name of the DO object that is referenced by attribute.
3. generateSecure - True if secure methods should be generated, otherwise false.
Context: <referrer>
If the column is a reference to another table, <reference_object> specifies the table.
Content: <CONSTRAINT>, <IS_ABSTRACT>, <IS_FOREIGN_KEY>, <PACKAGE>, <TABLE_NAME>
Attributes:
1. name - Name of the reference object class.
Context: <column>
Outer table that references generated class.
Content: <refattr>
Attributes:
1. name - Name of the outer table that references generated class.
2. package - Name of the outer table package that references generated class.
3. generateSecure - True if secure methods should be generated, otherwise false.
Context: <table>
Specifies the size of data types that are commonly measured in width, like VARCHAR. size must be an integer.
Content: None
Attributes: None
Context: <column>
Root element of XML files. It contains one table from database.
Content: <package>, <author>, <project_name>, <table_name>, <class_name>, <db_vendor>, <template_set>, <do_is_oid_based>, <is_any_column_secure>, <is_abstract>, <delete_cascades>, <column>, <referrer>, <index>, <generate_secure>, <generate_insecure>, <do_is_multidb_based>, <generate_dirty>
Attributes: None
Context: None
The name of the table in the database.
Content: None
Attributes: None
Context: <table>, <reference_object>
Template set that will be used for java code generation. The possible values for template_set are: standard (default) and <any user defined template>.
Content: None
Attributes: None
Context: <table>
The following snippet shows part of a transient file, Disc.xml (for table Disc from DiscRack example).
<TABLE>(1)
<PACKAGE>discRack.data.disc</PACKAGE>(2)
<AUTHOR>NN</AUTHOR>(2)
<PROJECT_NAME>DiscRack</PROJECT_NAME>(2)
<TABLE_NAME>Disc</TABLE_NAME>(2)
<CLASS_NAME>Disc</CLASS_NAME>(2)
<DB_VENDOR>Standard</DB_VENDOR>(2)
<TEMPLATE_SET>standard</TEMPLATE_SET>(4)
<GENERATE_SECURE>false</GENERATE_SECURE>(2)
<GENERATE_INSECURE>true</GENERATE_INSECURE>(2)
<DO_IS_OID_BASED>true</DO_IS_OID_BASED>(2)
<IS_ABSTRACT>false</IS_ABSTRACT>(2)
<DELETE_CASCADES>false</DELETE_CASCADES>(2)
<DO_IS_MULTIDB_BASED>false</DO_IS_MULTIDB_BASED>(2)
<IS_ANY_COLUMN_SECURE>false</IS_ANY_COLUMN_SECURE>(2)
<GENERATE_DIRTY>Compatible</GENERATE_DIRTY>(2)
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
<COLUMN name="artist">(2)
<IS_CONSTANT>false</IS_CONSTANT>(2)
<DB_TYPE>VARCHAR</DB_TYPE>(2)
<JAVA_TYPE>String</JAVA_TYPE>(2)
<USED_FOR_QUERY>true</USED_FOR_QUERY>(2)
<CAN_BE_NULL>false</CAN_BE_NULL>(2)
<IS_PRIMARY_KEY>false</IS_PRIMARY_KEY>(2)
<SIZE>32</SIZE>(2)
<GENERATE_SECURE>false</GENERATE_SECURE>(2)
<GENERATE_INSECURE>true</GENERATE_INSECURE>(2)
</COLUMN>(2)
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
<COLUMN name="owner">(2)
<REFERENCE_OBJECT name="Person">(3)
<CONSTRAINT>true</CONSTRAINT>(3)
<IS_ABSTRACT>false</IS_ABSTRACT>
<IS_FOREIGN_KEY>false</IS_FOREIGN_KEY>(3)
<PACKAGE>discRack.data.person</PACKAGE>(3)
<TABLE_NAME>person</TABLE_NAME>(3)
</REFERENCE_OBJECT>(3)
<IS_CONSTANT>false</IS_CONSTANT>(2)
<JAVADOC>/**
*Attribute describing a link to the owner of this disc.
*/</JAVADOC>(4)
<DB_TYPE>none</DB_TYPE>(2)
<JAVA_TYPE>discRack.data.person.PersonDO</JAVA_TYPE>(2)
<JAVA_DEFAULT_VALUE></JAVA_DEFAULT_VALUE>(4)
<USED_FOR_QUERY>true</USED_FOR_QUERY>(2)
<CAN_BE_NULL>false</CAN_BE_NULL>(2)
<IS_PRIMARY_KEY>false</IS_PRIMARY_KEY>(2)
<IS_ARRAY>false</IS_ARRAY>(2)
<GENERATE_SECURE>false</GENERATE_SECURE>(2)
<GENERATE_INSECURE>true</GENERATE_INSECURE>(2)
</COLUMN>(2)
</TABLE>(1)
Tags (1) must exist and must NOT be changed.
Tags (2) must exist and can be changed.
Tags (3) are not required.
Tags (4) can exist and must NOT be changed.