论坛首页 入门技术论坛

关于ibatis的辅助工具Abator

浏览 3975 次
该帖已经被评为新手帖
作者 正文
   发表时间:2007-04-12  

          今天看到了ibatis的eclipse下的这个插件,它的功能有:

Abator will generate:

  • SqlMap XML Files
  • Java Classes to match the primary key and fields of the table(s)
  • DAO Classes that use the above objects (optional)

Abator can run as a standalone JAR file, or as an Ant task, or as an Eclipse plugin。

感觉说的挺牛的,但是我按照它的文档却生成不了,不知道为什么,够郁闷的,我用的是hsqldb作测试,写了配置文件abatorConfig.xml,主要部分如下 :

<jdbcconnection driverclass="org.hsqldb.jdbcDriver"></jdbcconnection>jdbcConnection driverClass="org.hsqldb.jdbcDriver"

connectionURL="jdbc:hsqldb:."
        userId="sa"
        password=""   

<daogenerator targetproject="\IbatisDemo\" targetpackage="test.dao" type="IBATIS"></daogenerator>classPathEntry location="E:\opensource\HSQLDB\hsqldb_1_8_0_1\hsqldb\lib\hsqldb.jar"

javaModelGenerator targetPackage="test.Model" targetProject="\IbatisDemo\" 
sqlMapGenerator targetPackage="test.xml" targetProject="\IbatisDemo\" 
daoGenerator type="IBATIS" targetPackage="test.dao" targetProject="\IbatisDemo\"

测试主要的部分代码如下:

<!---->  List warnings = new ArrayList();  // Abator will add Strings to this list
     boolean overwrite = true;
     File configFile = new File("abatorConfig.xml");
     AbatorConfigurationParser cp = new AbatorConfigurationParser(warnings);
     AbatorConfiguration config = cp.parseAbatorConfiguration(configFile);
     DefaultShellCallback callback = new DefaultShellCallback(overwrite);
     Abator abator = new Abator(config, callback, warnings);
     abator.generate(null);
 可是就是没生成任何文档,够郁闷的,开始怀疑 这个插件的作用了,高手用过的给我指点一下,谢谢。

 

 

 

论坛首页 入门技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics