Weitere ähnliche Inhalte
Mehr von YoungSu Son (20)
Code Template with EA
- 3. 3. 메소드 속성에 맞는 태깅생성
예를 들어 현재 재고를 파악하는 메소드는
Database에서 데이터를 가져오는 (Get) 타
입인 경우.
3
- 4. 4. 코드 생성 탬플릿 작성
Settings – Code Generation Templates
다양한 생성할 코드
언어 선택 입력
생성할 코드 템
플릿
Namespace,
Class, Operation
등
스트레오 타입
별 템플릿을 지
정
4
- 6. 스트레오 템플릿 추가
Import Section
DLL 이나 Namespace를 추가하는 부분
Operation Body
메소드 구현 부에 사용자 코드를 추가 함
6
- 7. 간단한 예 - OperationBody
%if opTag:quot;DataAccessTypequot; ==quot;getquot; % //데이터를 얻어오는 쿼리
IDataReader reader = null;
%opReturnType% retVal = new %opReturnType%();
try
{
// 1. Create the Database object, using the default database service.
Database db = DatabaseFactory.CreateDatabase();
log.Debug(quot;Create Database Factoryquot;);
// 2. Create DB Command
string sqlCommand = quot;$queryNamequot;;
dbCommand = db.GetStoredProcCommand(sqlCommand);
log.Debug(quot;GetStoredProcCommand(quot; + sqlCommand + quot;)quot;);
….
} %elseIf opTag:quot;DataAccessTypequot; ==quot;setquot;% //데이터를 쓰는 쿼리
DbConnection connection = null;
UInt32 retVal = 0;
try
7
{ ……..
7