![]() |
![]() |
Speedo has its own enhancer for the following reasons:
Then to enhance persistent classes, Speedo provides a Ant task encasuplating the class org.objectweb.speedo.generation.SpeedoCompiler. The first chapter describes how to use/configure the Ant task in your ant build file. the second chapter explains how to use the EclipseJDO plugin with Speedo.
Back to the Speedo documentation
The provided Ant task is able to compile and enhance the persistent classes. It takes in parameter your .java and .jdo files.
Attribute | Description | Required |
confFile | This is the configuration file of the Speedo enhancer. Usually this file is the speedo.properties provided in the distribution. It permits to specify the mapper corresponding to the data support. It is not required, because the default mapper is for the relational database. | No |
output | Is the location of the .class of the user application. This is also the location where the Speedo files produced for the user persistent class is written. | Yes |
src | Is the location of the source of the user application. | Yes |
projectName | Is the name of the user project. If the user provides JORM persistent descriptor (legacy mapping case) like .pd files, the projectname must be specified and match the project name used in the .pd files. | No |
classpathref | Is the classpath containing Speedo, the user classes, and the configuration files (etc directory). | No |
logPropFile | Is the logging configuration file. It permits to choose another Monolog configuration file than the one provided in the etc directory | No |
failsonerror | indicates if the Speedo enhancer must stop after the first error or try to continue. The default value is true. | No |
The following example comes from the examples:
<property name="src" value="${basedir}/src"/> <property name="build" value="${basedir}/build"/> <property name="speedoDist" value="${basedir}/../.."/> ... <path id="classpath"> <pathelement location="${speedoDist}/etc"/> <pathelement location="${build}"/> <fileset dir="${speedoDist}"> <include name="speedo.jar"/> <include name="lib/log/log4j.jar"/> > <include name="lib/jdbc/postgres_jdbc2.jar"/> </fileset>
</path> ... <taskdef name ="speedo" classname="org.objectweb.speedo.ant.AntSpeedo" classpathref="classpath" /> ... <target="generation"> <delete dir="${build}"/> <mkdir dir="${build}"/> <javac srcdir="${src}" destdir="${build}" debug="on"> <classpath refid="classpath"/> <include name="**/*.java"/> </javac> <speedo src="${src}" output="${build}" classpathref="classpath"/>
Speedo is now compatible with the EclipseJDO plugin. With this plugin you can edit the .jdo files and enhance your persistent classes. To use Speedo with the eclipseJDO plugin, you have to add the plugin org.objectweb.speedo.eclipsejdo in Eclipse. This plugin integrate the speedo.jar librairies of Speedo. Then if you change of Speedo version you simply have to update the speedo.jar file in the plugin.