Ant
Talks about:
<a class="post-tag post-tag-ant" href="/tags/ant">Ant</a>
In order to use the YoSQL
tooling for Ant, follow these steps:
- Download the
yosql-tooling-ant
task zip file from the latest release (or any prior version). - Define a task in your build.xml. The
lib
folder of theyosql-tooling-ant
zip file contains all jar files that are required for the task. - Write
.sql
files in a directory of your choice (e.g./path/to/your/sql/files
). - Adjust the configuration of the
YoSQL
task. - Execute the
YoSQL
task in order to generate Java code.
An example build.xml file could look like this:
<project name="YourProject">
<description>
example showing how to use YoSQL with Ant
</description>
<!-- define YoSQL task -->
<taskdef name="yosql"
classname="wtf.metio.yosql.tooling.ant.YoSQLGenerateTask"
classpath="/path/of/all/yosql/jar/files"/>
<!-- configure YoSQL -->
<yosql>
<files inputBaseDirectory="/path/to/your/sql/files"
outputBaseDirectory="/path/for/writing/java/code"/>
<repositories generateInterfaces="true"/>
<converter>
<rowConverters alias="yourConverter"
converterType="com.example.YourConverter"
methodName="yourCustomMethod"
resultType="com.example.YourDomainObject"/>
</converter>
</yosql>
</project>