ibator安装很容易,有2种方式,在线和离线,在网上均有大把资料,使用也很简单,不再赘述。只提供ibator的配置文件ibatorConfig.xml基本内容以供参考:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE ibatorConfiguration PUBLIC "-//Apache Software Foundation//DTD Apache iBATIS Ibator Configuration 1.0//EN" "http://ibatis.apache.org/dtd/ibator-config_1_0.dtd" >
<!-- ibator自动生成javabean和dao配置文件 -->
<ibatorConfiguration >
<!-- jdbc驱动包绝对位置 -->
<classPathEntry location="D:\Workspaces\MyEclipse 10\tracesource\WebRoot\WEB-INF\lib\mysql-connector-java-5.0.7-bin.jar" />
<ibatorContext id="tracesource" >
<!-- 连接字符串 -->
<jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://localhost:3306/tracevegetables" userId="root" password="root" />
<!-- javabean包位置 -->
<javaModelGenerator targetPackage="com.yanglong.model" targetProject="tracesource" />
<!-- sqlmap位置 -->
<sqlMapGenerator targetPackage="com.yanglong.model" targetProject="tracesource" />
<!-- dao位置 -->
<daoGenerator targetPackage="com.yanglong.dao" targetProject="tracesource" type="spring" />
<!-- 映射表 -->
<table tableName="cfg_pri_role" domainObjectName="CfgPriRole"/>
<table tableName="cfg_user_role" domainObjectName="CfgUserRole"/>
<table tableName="plant_fertilize_log" domainObjectName="FertilizeLog"/>
<table tableName="plant_info" domainObjectName="PlantInfo"/>
<table tableName="plant_medicine_log" domainObjectName="MedicineLog"/>
<table tableName="plant_soil_log" domainObjectName="SoilLog"/>
<table tableName="plant_water_log" domainObjectName="WaterLog"/>
<table tableName="planter_info" domainObjectName="PlanterInfo"/>
<table tableName="pri_info" domainObjectName="PrivilegeInfo"/>
<table tableName="reco_info" domainObjectName="FeedbackInfo"/>
<table tableName="roler_info" domainObjectName="RolerInfo"/>
<table tableName="store_environment_info" domainObjectName="StoreEnvirInfo"/>
<table tableName="store_vegequality_info" domainObjectName="VegetablesQuality"/>
<table tableName="transport_environment_info" domainObjectName="TransportEnvirInfo"/>
<table tableName="user_info" domainObjectName="UserInfo"/>
<table tableName="verify_info" domainObjectName="VerifyInfo"/>
</ibatorContext>
</ibatorConfiguration>
附插件包及去注释版jar包。
分享到:
相关推荐
在这个项目中,ibator可能是iBatis的一个工具,它是iBatis的代码生成器,能自动生成基于数据库模式的Java实体类、Mapper接口和XML配置文件,大大提高了开发效率。 3. **ExtJS**:ExtJS是一个强大的JavaScript前端...
它的核心功能是根据数据库表结构自动生成Java源代码,包括Model类、Mapper接口和XML配置文件,帮助开发者快速构建基于Ibatis的数据访问层。 Ibatis是一个轻量级的持久层框架,它不同于ORM(对象关系映射)框架如...
- **创建配置文件**:通过Eclipse的“New” -> "Other"找到并选择Apache iBatis Ibator文件夹,然后创建`ibatorConfig.xml`配置文件。在这个配置文件中,需要填写关于数据库连接、生成代码的目标包和项目等信息。 ...
`ibator`,全称Apache iBATIS Auto Generator,是一个基于Java的代码生成工具,源自iBATIS项目,用于帮助开发者快速生成与数据库交互的Java类和XML映射文件。相较于Hibernate,ibator允许开发者拥有更多的SQL控制权...
ibator是ibatis提供的一种代码生成工具,它可以基于数据库表自动生成相应的Java实体类、Mapper接口以及XML配置文件等,极大地提高了开发效率。 ### 3. **Example模式介绍** Example模式是ibatis提供的一种查询方式...