Ibator 没有生成 Oracle varchar2 字段
我的表 APP_REQ_APPROVE_COMPARE 包含以下字段:
"ID" NUMBER NOT NULL ENABLE,
"TRACK_NO" VARCHAR2(20 BYTE) NOT NULL ENABLE,
"REQ_DATE" DATE NOT NULL ENABLE,
"OFFCODE" CHAR(6 BYTE) NOT NULL ENABLE,
"COMPARE_CASE_ID" NUMBER NOT NULL ENABLE,
"VEHICLE_NAME" VARCHAR2(100 BYTE),
"ENGINE_NO" VARCHAR2(100 BYTE),
"BODY_NO" VARCHAR2(100 BYTE),
"HOLD_SHIP" NUMBER,
"OWNERSHIP" VARCHAR2(200 BYTE),
"RENT_NAME" VARCHAR2(200 BYTE),
"CONTRACT" VARCHAR2(100 BYTE),
"CONTRACT_NO" VARCHAR2(100 BYTE),
"CONTRACT_DATE" DATE,
"ISLAWBREAKERRENT" CHAR(1 BYTE) NOT NULL ENABLE,
"MISTAKE_DETAIL" VARCHAR2(4000 BYTE),
"COMPARE_REASON" VARCHAR2(4000 BYTE),
"CREATE_BY" NUMBER NOT NULL ENABLE,
"CREATE_ON" DATE DEFAULT SYSDATE NOT NULL ENABLE,
"UPDATE_BY" NUMBER,
"UPDATE_ON" DATE,
当我使用 Ibator 生成 java bean 时,我没有找到 trackNo、VehicalName、...(所有字段都定义为 varchar2)。
我的情况有什么问题吗?这是我的 Ibator 配置文件:
<?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">
<ibatorConfiguration>
<classPathEntry location="/dos/connector/oracle_jdbc.jar"/>
<ibatorContext id="autoPerson" defaultModelType="flat"
targetRuntime="Ibatis2Java2">
<jdbcConnection
connectionURL="jdbc:oracle:thin:@192.168.42.144:1521:orcl"
driverClass="oracle.jdbc.driver.OracleDriver"
userId="user"
password="password"/>
<javaModelGenerator targetPackage="com.ko.model"
targetProject="FormConfig">
<property name="enableSubPackages" value="true"/>
<property name="trimStrings" value="true"/>
</javaModelGenerator>
<sqlMapGenerator targetPackage="com.ko.map" targetProject="FormConfig">
<property name="enableSubPackages" value="true"/>
</sqlMapGenerator>
<daoGenerator
targetPackage="com.ko.model.dao"
type="SPRING"
targetProject="FormConfig"
implementationPackage="com.ko.model.dao.impl" >
<property name="enableSubPackges" value="true"/>
<property name="methodNameCalculator" value="extended"/>
</daoGenerator>
<table tableName="APP_REQ_APPROVE_COMPARE"
domainObjectName="AppReqApproveCompare"/>
<ibatorConfiguration>
I have table APP_REQ_APPROVE_COMPARE with following fields:
"ID" NUMBER NOT NULL ENABLE,
"TRACK_NO" VARCHAR2(20 BYTE) NOT NULL ENABLE,
"REQ_DATE" DATE NOT NULL ENABLE,
"OFFCODE" CHAR(6 BYTE) NOT NULL ENABLE,
"COMPARE_CASE_ID" NUMBER NOT NULL ENABLE,
"VEHICLE_NAME" VARCHAR2(100 BYTE),
"ENGINE_NO" VARCHAR2(100 BYTE),
"BODY_NO" VARCHAR2(100 BYTE),
"HOLD_SHIP" NUMBER,
"OWNERSHIP" VARCHAR2(200 BYTE),
"RENT_NAME" VARCHAR2(200 BYTE),
"CONTRACT" VARCHAR2(100 BYTE),
"CONTRACT_NO" VARCHAR2(100 BYTE),
"CONTRACT_DATE" DATE,
"ISLAWBREAKERRENT" CHAR(1 BYTE) NOT NULL ENABLE,
"MISTAKE_DETAIL" VARCHAR2(4000 BYTE),
"COMPARE_REASON" VARCHAR2(4000 BYTE),
"CREATE_BY" NUMBER NOT NULL ENABLE,
"CREATE_ON" DATE DEFAULT SYSDATE NOT NULL ENABLE,
"UPDATE_BY" NUMBER,
"UPDATE_ON" DATE,
When I generate a java bean using Ibator , I didn't find trackNo, VehicalName, ... (all fields defined as varchar2).
What is the problem in my case? Here is my Ibator configuration file:
<?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">
<ibatorConfiguration>
<classPathEntry location="/dos/connector/oracle_jdbc.jar"/>
<ibatorContext id="autoPerson" defaultModelType="flat"
targetRuntime="Ibatis2Java2">
<jdbcConnection
connectionURL="jdbc:oracle:thin:@192.168.42.144:1521:orcl"
driverClass="oracle.jdbc.driver.OracleDriver"
userId="user"
password="password"/>
<javaModelGenerator targetPackage="com.ko.model"
targetProject="FormConfig">
<property name="enableSubPackages" value="true"/>
<property name="trimStrings" value="true"/>
</javaModelGenerator>
<sqlMapGenerator targetPackage="com.ko.map" targetProject="FormConfig">
<property name="enableSubPackages" value="true"/>
</sqlMapGenerator>
<daoGenerator
targetPackage="com.ko.model.dao"
type="SPRING"
targetProject="FormConfig"
implementationPackage="com.ko.model.dao.impl" >
<property name="enableSubPackges" value="true"/>
<property name="methodNameCalculator" value="extended"/>
</daoGenerator>
<table tableName="APP_REQ_APPROVE_COMPARE"
domainObjectName="AppReqApproveCompare"/>
<ibatorConfiguration>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Ibator 版本 1.2.0,已修复错误:
修复了 JavaTypeResolver,以便具有不支持的数据类型的列可能会被配置覆盖。
Ibator Version 1.2.0, Bugs Fixed:
Fixed the JavaTypeResolver so that columns with unsupported data types may be overridden by configuration.