Sysmod
|
Ant Script
|
Sysmod makes use of Ant in order to generate the code. The Ant Task is called GenerateModelTask.
First the sysmod task must be defined. Sysmod supports several generators, although the only one
really used to date has been the Java and SQL generators.
<target name="generatedemo" depends="dist">
<delete dir="gen"/>
<mkdir dir="gen"/>
<mkdir dir="gen/java"/>
<mkdir dir="gen/sql"/>
<mkdir dir="gen/bin"/>
<taskdef name="sysmod" classname="net.sourceforge.sysmod.GenerateModelTask"
classpathref="demolibs"/>
<sysmod modelXML="demo_model.xml">
<genclass classname="net.sourceforge.sysmod.generators.JavaGenerator"
destdir="gen/java" includedir="include/java" ext="java">
<classproperty name="package" value="net.sourceforge.sysmod.tests"/>
<classproperty name="baseclass"
value="net.sourceforge.sysmod.support.AbstractDataObject"/>
<classproperty name="jndiname" value="jdbc/sysmod"/>
<classproperty name="usecache" value="no"/>
<classproperty name="connectionmethod"
value="net.sourceforge.sysmod.support.ConnectionFactory.getConnection();"/>
</genclass>
<genclass classname="net.sourceforge.sysmod.generators.SQLGenerator"
destdir="gen/sql" ext="sql">
<classproperty name="dbtype" value="postgresql"/>
</genclass>
</sysmod>
</target>
|
Tag |
Attribute |
Description |
sysmod | modelXML | Filename of the sysmod model. |
genclass | | The genclass tag specified a generator. |
genclass | classname | The class name of the Generator to call. |
genclass | destdir | The distination directory to save output to. |
genclass | includedir | The directory for include files. |
genclass | ext | The extension to use for generated files. |
classproperty | | Holds parameters for the Generator. |
Property Name | Description |
package | The package that the generated code will be part of. |
baseclass | The class that the data objects will extend. Usually you will extend
from the base class supplied within sysmod. |
jndiname | The JNDI name used to obtain a connection with the database. |
usecache | Will you generate code which can cache objects in memory? |
connnectionmethod | The fully qualified name of the method to obtain connections.
Usually you will use the default ConnectionFactory.getConnection() method. |
|
|