ibator 란
- 아파치 재단에서 만든 데이터맵핑 프레임워크인 iBatis를 위한 소스 생성 툴
- 생성 소스 (테이블 단위로 기본적인 insert,update,delete,select 관련소스)
- SqlMap XML Files
- Java Classes to match the primary key and fields of the table
- DAO Classes
Eclipse plugin 설치
- Take the "Help>install new software..." Menu Option
- Press the "Add" button
- Enter the following information: Location: http://ibatis.apache.org/tools/ibator
- Press OK
- Check the box next to "Apache iBATISIbator Feature"
- Press the "Install" button
- Follow the remainder of the install wizard
ibatorConfig.xml(소스 생성 설정파일) 만들기
마우스 오른쪽 키 -- new -- other 선택
생성된 파일
<?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>
<ibatorContext id="context1">
<jdbcConnection driverClass="???" connectionURL="???" userId="???" password="???" />
<javaModelGenerator targetPackage="???" targetProject="???" />
<sqlMapGenerator targetPackage="???" targetProject="???" />
<daoGenerator targetPackage="???" targetProject="???" type="GENERIC-CI" />
<table schema="???" tableName="???">
<columnOverride column="???" property="???" />
</table>
</ibatorContext>
</ibatorConfiguration>
수정된 파일
<?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="D:\MyIDE\LIB\jdbc\oracle\ojdbc6.jar" />
<!-- <ibatorContext id="CT_COMM_CD_DESC" >
<jdbcConnection driverClass="oracle.jdbc.OracleDriver" connectionURL="dburl" userId="user" password="pass" />
<javaModelGenerator targetPackage="database.model" targetProject="dwmsc" />
<sqlMapGenerator targetPackage="database.dao.sqlmap" targetProject="dwmsc" />
<daoGenerator targetPackage="database.dao" targetProject="dwmsc" type="GENERIC-CI" />
<table schema="ACNT" tableName="CT_COMM_CD_DESC" enableSelectByExample="false" enableDeleteByExample="false"
enableCountByExample="false" enableUpdateByExample="false"/>
</ibatorContext> -->
<ibatorContext id="AT_ACNT">
<jdbcConnection driverClass="oracle.jdbc.OracleDriver" connectionURL="dburl" userId="user" password="pass" />
<javaModelGenerator targetPackage="database.model" targetProject="dwmsc" />
<sqlMapGenerator targetPackage="dao.sqlmap" targetProject="dwmsc" />
<daoGenerator targetPackage="database.dao" targetProject="dwmsc" type="GENERIC-CI" />
<table schema="ACNT" tableName="AT_ACNT" enableSelectByExample="false"
enableDeleteByExample="false" enableCountByExample="false" enableUpdateByExample="false" />
</ibatorContext>
</ibatorConfiguration>
소스 파일 생성
728x90
'■ Data Skill ■ > MyBatis' 카테고리의 다른 글
[MyBatis] MyBatis 설정, 간단한 예제, 스프링 Bean 등록 (0) | 2023.02.25 |
---|---|
[iBatis] iBatis- LIKE 조건, IN 조건 만들기 (0) | 2023.02.25 |
[iBatis] iBatis LIKE 구문과 Dynamic SQL을 사용할 때 (0) | 2023.02.25 |
댓글