Frames No Frames

The <abatorContext> Element

The <abatorContext> element is used to specify the environment for generating a set of objects. Child elements are used to specify the database to connect to, the type of objects to generate, and the tables to introspect. Multiple <abatorContext> elements can be listed inside an <abatorConfiguration> element to allow generating objects from different databases, or with different generation parameters, in the same run of Abator.

Required Attributes

None

Optional Attributes

Attribute Description
defaultModelType This property is used to set the default for generated model types. The model type defines how Abator will generate domain classes. With some model types Abator will generate a single domain class for each table, with others Abator may generate different classes depending on the structure of the table. The property supports these values:
conditional This is the default value
This model is similar to the hierarchical model except that a separate class will not be generated if that separate class would only contain one field. So if a table has only one primary key field, that field will be merged into the base record class.
flat This model generates only one domain class for any table. The class will hold all fields in the table.
hierarchical This model is the same as the model shipped with the initial versions of Abator. This model will generate a primary key class if the table has a primary key, another class that holds any BLOB columns in the table, and another class that holds the remaining fields. There is an appropriate inheritance relationship between the classes.
id A unique identifier for this context. This value will be used in some error messages.
generatorSet This property is used to select different sets of code generators, with different behaviors. The property supports these values:
Legacy This is the default value
This set of code generators generate objects that are compatible with all iBATIS versions and all levels of Java 2. The "by example" methods in these generated objects are somewhat limited - those methods are much more functional with the other generators. These are the original code generators shipped with early versions of Abator. We strongly recommend that you choose one of the other generator sets. This set remains the default for backward compatibility reasons, but may be removed in some future version of Abator.
Java2 This set of code generators generate objects that are compatible with iBATIS versions 2.2.0 and higher, and all levels of Java 2. The "by example" methods in these generated objects support virtually unlimited dynamic where clauses. The objects generated with this set of generators are not 100% compatible with the objects generated with the original version of Abator, or one of the other sets of code generators.
Java5 This set of code generators generate objects that are compatible with iBATIS versions 2.2.0 and higher, and JSE 5.0 and higher. The "by example" methods in these generated objects support virtually unlimited dynamic where clauses. Additionally, the Java objects generated with these generators support many JSE 5.0 features including parameterized types and annotations. The objects generated with this set of generators are not 100% compatible with the objects generated with the original version of Abator, or one of the other sets of code generators.

Child Elements

Supported Properties

This table lists the properties that can be specified with the <property> child element:

Property Name Property Values
suppressTypeWarnings If true, then Abator will add an annotation to any method that uses a non-parameterized type to suppress compiler type warnings. This is useful if you are using the Legacy or Java2 generator sets, but are compiling the generated objects with a JSE 5.0 compiler. In that situation, the Abator generated code would generate many compiler warnings if the annotation is not allowed. This property is not needed and will have no effect when using the Java5 generator set.

The default value is false.

beginningDelimiter The value to use as the beginning identifier delimiter for SQL identifiers that require delimiters. Abator will automatically delimit SQL identifiers if the identifier contains a space. Abator will also delimit SQL identifiers if specifically requested in a <table> or <columnOverride> configuration.

The default value is double quotes (").

endingDelimiter The value to use as the ending identifier delimiter for SQL identifiers that require delimiters. Abator will automatically delimit SQL identifiers if the identifier contains a space. Abator will also delimit SQL identifiers if specifically requested in a <table> or <columnOverride> configuration.

The default value is double quotes (").