Adding Plugins to Ibator
Saturday, February 20th, 2010Ibator (formerly knows as ‘Abator’) is an invaluable code generator to create all necessary code to access database tables with the (also pretty invaluable) Java OR framework Ibatis.
Ibator creates a variety of SQL code to easily build here-clauses to acces your tables. The one thing that is missing is support for the SQl “limit” clause which is offered by Mysql and other popular databases.
A guy called harawata has created a plugin for Ibator, which creates code to easily add “limit” clauses to your db-calls. Thank a lot for this (once again invaluable) tool! You might also want to check out his other plugins.
Ok, so now how to add these Plugins to the code generator? You need to compile the classes with ibator.jar in the classpath.
Then enable the Plugin in your ibatorConfig.xml file within the <ibatorContext>:
<ibatorPlugin type=”AddLimitClausePlugin”></ibatorPlugin>
Finally add the resulting Plugin-file to the classpath when calling Ibator:
java -cp ibator.jar:limit.jar org.apache.ibatis.ibator.api.IbatorRunner -configfile ibatorConfig.xml -overwrite
Of course this will also work when starting Ibator from an ant file.


