Frames No Frames
The <sqlMapGenerator> element is used to define properties of the SQL map generator. The SQL Map Generator builds an iBATIS formatted SQL map for each introspected table. This element is a required child element of the <abatorContext> element.
If you don't specify a user defined type, Abator will select a default
generator based on the value of the
generatorSet property of the
<abatorContext> element. See the notes on that
page for features of the different types of generators.
|targetPackage||This is the package where the generated SQL Maps will be placed. In the default generators, the property "enableSubPackages" controls how the actual package is calculated. If true, then the calculated package will be the targetPackage plus sub packages for the table's catalog and schema if they exist. If false (the default) then the calculated package will be exactly what is specified in the targetPackage attribute. Abator will create folders as required for the generated packages.|
|targetProject||This is used to specify a target project for the generated SQL maps. When running in the Eclipse environment, this specifies the project and source folder where the objects will be saved. In other environments, this value should be an existing directory on the local file system. Abator will not create this directory if it does not exist.|
|type||This can be used to specify a user provided Java model generator. The class must implement the interface org.apache.ibatis.abator.api.SqlMapGenerator, and must have a public default constructor. The attribute also accepts the special value DEFAULT in which case the default implementation will be used (this has the same effect as not specifying the type).|
This table lists the properties of the default SQL Map generators that can be specified with the <property> child element:
|Property Name||Property Values|
|enableSubPackages||This property is used to select whether Abator will generate different
Java packages for the objects based on the catalog and schema of the
For example, suppose a table MYTABLE in schema MYSCHMA. Also suppose that the targetPackage attribute is set to "com.mycompany". If this property is true, the generated SQL Map for the table will be placed in the package "com.mycompany.myschema". If the property is false, the generated SQL Map will be placed in the "com.mycompany" schema.
The default value is false.
This element specifies that we always want to place generated SQL Maps in the "'test.model" package and that we want to use subpackages based on the table schema and catalog.
<sqlMapGenerator targetPackage="test.model" targetProject="\MyProject\src"> <property name="enableSubPackages" value="true" /> </sqlMapGenerator>