/*******************************************************************************
*	 All Rights reserved,Copyright (c) K-Opticom 
********************************************************************************
*＜プログラム内容＞
*	システム名		：eo顧客基幹システム
*	モジュール名	：JSYejbZM0081KRCK
*	ソースファイル名：JSYejbZM0081KRCK.java
*	作成者			：EK916889
*	日付			：2016年01月06日
*＜機能概要＞
*	関連チェック部品です。
*＜修正履歴＞
*	バージョン	修正日		修正者		修正内容
*	ｖ1.00.00
*
********************************************************************************/

package eo.ejb.cbm.entity;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.text.ParsePosition;
import com.fujitsu.futurity.model.ejb.common.JSYejbLog;
import com.fujitsu.futurity.model.ejb.common.JSYejbConnection;
import com.fujitsu.futurity.model.ejb.common.StatusCodes;
import com.fujitsu.futurity.model.ejb.common.fw.AgentDispatchContext;
import eo.ejb.common.EventIDList;
import com.fujitsu.futurity.model.ejb.common.fw.KanrenCheckHandler;
import eo.ejb.common.JKKModelCommon;
import eo.ejb.common.JPCModelCommon;
import eo.ejb.common.entity.JTUejbZM0081KRCK;

import com.fujitsu.futurity.model.base.CAANConnectionMgr;
import com.fujitsu.futurity.model.base.CAANJDBCUtil;
import com.fujitsu.futurity.model.base.CAANMsg;
import com.fujitsu.futurity.model.base.CAANRuntimeException;

/**
 * 住所関連チェッククラスです。
 * ＜メソッド一覧＞
 * invoke
 *	execICK0011D001_5
 *	execICK0011D001_8
 *	execICK0011D002_3
 *	execICK0011D002_4
 *	execICK0011D002_6
 *	execICK0011D003_5
 *	execICK0011D003_6
 *	execICK0011D008_3
 *	execICK0011D008_4
 *	execICK0011D008_6
 *	execICK0011D016_3
 *	execICK0011D016_4
 *	execICK0011D023_3
 *	execICK0011D023_4
 *	execICK0011D023_5
 *	execICK0021D001_3
 *	execICK0021D001_4
 *	execICK0021D002_3
 *	execICK0021D002_4
 *	execICK0021D004_2
 *	execICK0021D004_3
 *	execICK0041D001_2
 *	execICK0041D003_4
 *	execICK0041D004_3
 *	execICK0041D005_2
 *	execICK0051C001_2
 *	execICK0051D001_2
 *	execICK0061C003_2
 *	execICK0061D001_6
 *	execIKK0061D001_4
 *	execIKK0061D002_4
 *	execIKK0191D003_4
 *	execIKK0191D003_5
 *	execIKK0191D006_2
 *	execIKK0191D012_2
 *	execIKK0191D012_3
 *	execIKK0191D015_2
 *	execIKK0251D002_4
 *	execIKK0251D005_4
 *	execIKK0251D010_4
 *	execIKK0341C010_2
 *	execIKK0341C016_8
 *	execIKK0341C023_2
 *	execIKK0341D002_12
 *	execIKK0341D002_13
 *	execIKK0341D004_12
 *	execIKK0341D004_13
 *	execIKK0341D037_3
 *	execIKK0341D037_6
 *	execIKK0381D001_2
 *	execIKK0381D004_2
 *	execIKK0491D001_7
 *	execIKK0491D003_3
 *	execIKK0491D006_6
 *	execIKK0561D001_3
 *	execIKK0581C001_2
 *	execIKK0581D001_2
 *	execIKK0931D001_6
 *	execIKK1951C001_4
 *	execIKK1951D001_4
 *	execIKK1951D001_5
 *	execIKK2691C001_3
 *	execIKK2691D001_3
 *	execIKK3011D001_4
 *	execITU0011C002_12
 *	execITU0011C002_13
 *	execITU0011C002_14
 *	execITU0011D004_1
 *	execITU0011D004_2
 *	execITU0011D004_3
 *	execITU0021C002_3
 *	execITU0021D001_3
 *	execITU0021D002_3
 *	execITU0091C001_3
 *	execITU0091C001_4
 *	execIZM0081C001_1
 *	execIZM0081C001_2
 *	execIZM0081D001_1
 *	execIZM0081D001_2
 *	execIZM0081D001_7
 *	execIZM0081D001_8
 *	execIZM0081D003_1
 *	execIZM0081D003_2
 *	execIZM0081D004_1
 *	execIZM0081D004_2
 *	execIZM0081D004_7
 *	execIZM0081D004_8
 *	execIZM0081D005_1
 *	execIZM0081D005_2
 *	execIZM0081D005_7
 *	execIZM0081D005_8
 *	execIZM0091D002_3
 *	execIZM0091D003_3
 *	execIZM0091D004_3
 *	execIZM0091D005_3
 *
 */

public class JSYejbZM0081KRCK implements KanrenCheckHandler {

	/**
	 * コンストラクタ
	 */

	public JSYejbZM0081KRCK() {
	}

	/**
	 * 住所関連チェックを行います。
	 * 
	 * @param inETMsg エンティティ
	 * @param inContext Agentから渡されたAgentDispatchContext
	 */

	public void invoke(CAANMsg inETMsg, AgentDispatchContext inContext) {

		JSYejbLog.println(JSYejbLog.DEBUG, getClass(), "call:JSYejbZM0081KRCK.invoke");

		// inETMsgのチェック
		if(inETMsg == null) {
			throw new CAANRuntimeException("inETMsgがnullです。");
		}

		// 振舞IDの取り出し
		String eventID = inETMsg.getString("eventID");
		if(eventID == null) {
			throw new CAANRuntimeException("振舞IDがnullです。");
		}

		// 処理の振り分け
		// イベントの振り分け
		if(eventID.equals(EventIDList.ICK0011D001)){
			/** お客様<法人>登録振舞内部 */
			int Rtn = 0;
			Rtn = execICK0011D001_5(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execICK0011D001_8(inETMsg, inContext, "EA");
			}

		}else if(eventID.equals(EventIDList.ICK0011D002)){
			/** お客様<個人>内容変更振舞内部 */
			int Rtn = 0;
			Rtn = execICK0011D002_3(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execICK0011D002_4(inETMsg, inContext, "EA");
			}

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execICK0011D002_6(inETMsg, inContext, "EA");
			}

		}else if(eventID.equals(EventIDList.ICK0011D003)){
			/** お客様<個人>登録振舞内部 */
			int Rtn = 0;
			Rtn = execICK0011D003_5(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execICK0011D003_6(inETMsg, inContext, "EA");
			}

		}else if(eventID.equals(EventIDList.ICK0011D008)){
			/** お客様<法人>内容変更振舞内部 */
			int Rtn = 0;
			Rtn = execICK0011D008_3(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execICK0011D008_4(inETMsg, inContext, "EA");
			}

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execICK0011D008_6(inETMsg, inContext, "EA");
			}

		}else if(eventID.equals(EventIDList.ICK0011D016)){
			/** お客様<個人>仮登録振舞内部 */
			int Rtn = 0;
			Rtn = execICK0011D016_3(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execICK0011D016_4(inETMsg, inContext, "EA");
			}

		}else if(eventID.equals(EventIDList.ICK0011D023)){
			/** お客様<法人>内容変更振舞内部２ */
			int Rtn = 0;
			Rtn = execICK0011D023_3(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execICK0011D023_4(inETMsg, inContext, "EA");
			}

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execICK0011D023_5(inETMsg, inContext, "EA");
			}

		}else if(eventID.equals(EventIDList.ICK0021D001)){
			/** お客様<個人>内容変更振舞内部 */
			int Rtn = 0;
			Rtn = execICK0021D001_3(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execICK0021D001_4(inETMsg, inContext, "EA");
			}

		}else if(eventID.equals(EventIDList.ICK0021D002)){
			/** お客様<個人>登録振舞内部 */
			int Rtn = 0;
			Rtn = execICK0021D002_3(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execICK0021D002_4(inETMsg, inContext, "EA");
			}

		}else if(eventID.equals(EventIDList.ICK0021D004)){
			/** お客様<個人>仮登録振舞内部 */
			int Rtn = 0;
			Rtn = execICK0021D004_2(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execICK0021D004_3(inETMsg, inContext, "EA");
			}

		}else if(eventID.equals(EventIDList.ICK0041D001)){
			/** お客様<法人>登録振舞内部 */
			int Rtn = 0;
			Rtn = execICK0041D001_2(inETMsg, inContext, "EA");

		}else if(eventID.equals(EventIDList.ICK0041D003)){
			/** 法人連絡先登録振舞内部 */
			int Rtn = 0;
			Rtn = execICK0041D003_4(inETMsg, inContext, "EA");

		}else if(eventID.equals(EventIDList.ICK0041D004)){
			/** 法人連絡先変更振舞内部 */
			int Rtn = 0;
			Rtn = execICK0041D004_3(inETMsg, inContext, "EA");

		}else if(eventID.equals(EventIDList.ICK0041D005)){
			/** お客様<法人>内容変更振舞内部２ */
			int Rtn = 0;
			Rtn = execICK0041D005_2(inETMsg, inContext, "EA");

		}else if(eventID.equals(EventIDList.ICK0051C001)){
			/** 問合せ客変更振舞内部 */
			int Rtn = 0;
			Rtn = execICK0051C001_2(inETMsg, inContext, "EB");

		}else if(eventID.equals(EventIDList.ICK0051D001)){
			/** 問合せ客登録振舞内部 */
			int Rtn = 0;
			Rtn = execICK0051D001_2(inETMsg, inContext, "EB");

		}else if(eventID.equals(EventIDList.ICK0061C003)){
			/** 不良顧客変更振舞内部 */
			int Rtn = 0;
			Rtn = execICK0061C003_2(inETMsg, inContext, "EA");

		}else if(eventID.equals(EventIDList.ICK0061D001)){
			/** 不良顧客登録振舞内部 */
			int Rtn = 0;
			Rtn = execICK0061D001_6(inETMsg, inContext, "EA");

		}else if(eventID.equals(EventIDList.IKK0061D001)){
			/** 代理店登録振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0061D001_4(inETMsg, inContext, "EA");

		}else if(eventID.equals(EventIDList.IKK0061D002)){
			/** 代理店変更振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0061D002_4(inETMsg, inContext, "EA");

		}else if(eventID.equals(EventIDList.IKK0191D003)){
			/** サービス契約内訳<eo光電話>登録振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0191D003_4(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIKK0191D003_5(inETMsg, inContext, "EA");
			}

		}else if(eventID.equals(EventIDList.IKK0191D006)){
			/** サービス契約内訳<eo光電話>情報変更振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0191D006_2(inETMsg, inContext, "EA");

		}else if(eventID.equals(EventIDList.IKK0191D012)){
			/** サービス契約内訳<eo光電話>番ポ情報変更振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0191D012_2(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIKK0191D012_3(inETMsg, inContext, "EA");
			}

		}else if(eventID.equals(EventIDList.IKK0191D015)){
			/** サービス契約内訳<eo光電話>情報変更(住変)振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0191D015_2(inETMsg, inContext, "EA");

		}else if(eventID.equals(EventIDList.IKK0251D002)){
			/** サービス契約回線内訳登録振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0251D002_4(inETMsg, inContext, "EA");

		}else if(eventID.equals(EventIDList.IKK0251D005)){
			/** サービス契約回線内訳内容変更振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0251D005_4(inETMsg, inContext, "EA");

		}else if(eventID.equals(EventIDList.IKK0251D010)){
			/** サービス契約回線内訳登録（住所変更）振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0251D010_4(inETMsg, inContext, "EA");

		}else if(eventID.equals(EventIDList.IKK0341C010)){
			/** 機器提供サービス契約配送先確定振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0341C010_2(inETMsg, inContext, "EA");

		}else if(eventID.equals(EventIDList.IKK0341C016)){
			/** 機器提供サービス契約情報変更（契約変更中）振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0341C016_8(inETMsg, inContext, "EA");

		}else if(eventID.equals(EventIDList.IKK0341C023)){
			/** 機器提供サービス契約情報変更（住所更新）振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0341C023_2(inETMsg, inContext, "EA");

		}else if(eventID.equals(EventIDList.IKK0341D002)){
			/** 機器提供サービス契約登録振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0341D002_12(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIKK0341D002_13(inETMsg, inContext, "EA");
			}

		}else if(eventID.equals(EventIDList.IKK0341D004)){
			/** 機器提供サービス契約情報変更振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0341D004_12(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIKK0341D004_13(inETMsg, inContext, "EA");
			}

		}else if(eventID.equals(EventIDList.IKK0341D037)){
			/** 機器提供サービス契約情報変更（住所変更）振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0341D037_3(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIKK0341D037_6(inETMsg, inContext, "EA");
			}

		}else if(eventID.equals(EventIDList.IKK0381D001)){
			/** オプションサービス契約<TV>登録振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0381D001_2(inETMsg, inContext, "EA");

		}else if(eventID.equals(EventIDList.IKK0381D004)){
			/** オプションサービス契約<TV>情報変更振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0381D004_2(inETMsg, inContext, "EA");

		}else if(eventID.equals(EventIDList.IKK0491D001)){
			/** 請求契約登録振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0491D001_7(inETMsg, inContext, "EA");

		}else if(eventID.equals(EventIDList.IKK0491D003)){
			/** 請求契約内容変更振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0491D003_3(inETMsg, inContext, "EA");

		}else if(eventID.equals(EventIDList.IKK0491D006)){
			/** 請求契約登録（予約情報入力）振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0491D006_6(inETMsg, inContext, "EA");

		}else if(eventID.equals(EventIDList.IKK0561D001)){
			/** 通知書登録振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0561D001_3(inETMsg, inContext, "EA");

		}else if(eventID.equals(EventIDList.IKK0581C001)){
			/** 電波障害案件変更振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0581C001_2(inETMsg, inContext, "EA");

		}else if(eventID.equals(EventIDList.IKK0581D001)){
			/** 電波障害案件登録振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0581D001_2(inETMsg, inContext, "EA");

		}else if(eventID.equals(EventIDList.IKK0931D001)){
			/** サービス提供エリア警告対象住所登録振舞内部 */
			int Rtn = 0;
			Rtn = execIKK0931D001_6(inETMsg, inContext, "EA");

		}else if(eventID.equals(EventIDList.IKK1951C001)){
			/** 住所変更申込電話番号一時保存更新振舞内部 */
			int Rtn = 0;
			Rtn = execIKK1951C001_4(inETMsg, inContext, "EA");

		}else if(eventID.equals(EventIDList.IKK1951D001)){
			/** 住所変更申込電話番号一時保存登録振舞内部 */
			int Rtn = 0;
			Rtn = execIKK1951D001_4(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIKK1951D001_5(inETMsg, inContext, "EA");
			}

		}else if(eventID.equals(EventIDList.IKK2691C001)){
			/** 地図顧客位置ワーク変更振舞内部 */
			int Rtn = 0;
			Rtn = execIKK2691C001_3(inETMsg, inContext, "EA");

		}else if(eventID.equals(EventIDList.IKK2691D001)){
			/** 地図顧客位置ワーク登録振舞内部 */
			int Rtn = 0;
			Rtn = execIKK2691D001_3(inETMsg, inContext, "EA");

		}else if(eventID.equals(EventIDList.IKK3011D001)){
			/** 契約内容通知書登録振舞内部 */
			int Rtn = 0;
			Rtn = execIKK3011D001_4(inETMsg, inContext, "EA");

		}else if(eventID.equals(EventIDList.ITU0011C002)){
			/** 番ポ工事内容変更振舞内部 */
			int Rtn = 0;
			Rtn = execITU0011C002_12(inETMsg, inContext, "EC");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execITU0011C002_13(inETMsg, inContext, "ED");
			}

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execITU0011C002_14(inETMsg, inContext, "EE");
			}

		}else if(eventID.equals(EventIDList.ITU0011D004)){
			/** 番ポ工事登録振舞内部 */
			int Rtn = 0;
			Rtn = execITU0011D004_1(inETMsg, inContext, "EB");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execITU0011D004_2(inETMsg, inContext, "EC");
			}

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execITU0011D004_3(inETMsg, inContext, "ED");
			}

		}else if(eventID.equals(EventIDList.ITU0021C002)){
			/** 同番移転内容変更振舞内部 */
			int Rtn = 0;
			Rtn = execITU0021C002_3(inETMsg, inContext, "EC");

		}else if(eventID.equals(EventIDList.ITU0021D001)){
			/** 同番移転登録 */
			int Rtn = 0;
			Rtn = execITU0021D001_3(inETMsg, inContext, "EC");

		}else if(eventID.equals(EventIDList.ITU0021D002)){
			/** 同番移転登録(住変用)振舞内部 */
			int Rtn = 0;
			Rtn = execITU0021D002_3(inETMsg, inContext, "EC");

		}else if(eventID.equals(EventIDList.ITU0091C001)){
			/** 電話帳申込内容内容変更振舞内部 */
			int Rtn = 0;
			Rtn = execITU0091C001_3(inETMsg, inContext, "EC");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execITU0091C001_4(inETMsg, inContext, "ED");
			}

		}else if(eventID.equals(EventIDList.IZM0081C001)){
			/** 住所削除振舞内部 */
			int Rtn = 0;
			Rtn = execIZM0081C001_1(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIZM0081C001_2(inETMsg, inContext, "EB");
			}

		}else if(eventID.equals(EventIDList.IZM0081D001)){
			/** 住所変更振舞内部 */
			int Rtn = 0;
			Rtn = execIZM0081D001_1(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIZM0081D001_2(inETMsg, inContext, "EB");
			}

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIZM0081D001_7(inETMsg, inContext, "EE");
			}

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIZM0081D001_8(inETMsg, inContext, "EF");
			}

		}else if(eventID.equals(EventIDList.IZM0081D003)){
			/** 住所登録振舞内部 */
			int Rtn = 0;
			Rtn = execIZM0081D003_1(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIZM0081D003_2(inETMsg, inContext, "EB");
			}

		}else if(eventID.equals(EventIDList.IZM0081D004)){
			/** 住所予約振舞内部 */
			int Rtn = 0;
			Rtn = execIZM0081D004_1(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIZM0081D004_2(inETMsg, inContext, "EB");
			}

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIZM0081D004_7(inETMsg, inContext, "EE");
			}

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIZM0081D004_8(inETMsg, inContext, "EF");
			}

		}else if(eventID.equals(EventIDList.IZM0081D005)){
			/** 住所適用終了日変更振舞内部 */
			int Rtn = 0;
			Rtn = execIZM0081D005_1(inETMsg, inContext, "EA");

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIZM0081D005_2(inETMsg, inContext, "EB");
			}

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIZM0081D005_7(inETMsg, inContext, "EE");
			}

			if(Rtn <= StatusCodes.WARNING){
				Rtn = execIZM0081D005_8(inETMsg, inContext, "EF");
			}

		}else if(eventID.equals(EventIDList.IZM0091D002)){
			/** 住所対象番号区画変更振舞内部 */
			int Rtn = 0;
			Rtn = execIZM0091D002_3(inETMsg, inContext, "WC");

		}else if(eventID.equals(EventIDList.IZM0091D003)){
			/** 住所対象番号区画予約振舞内部 */
			int Rtn = 0;
			Rtn = execIZM0091D003_3(inETMsg, inContext, "WC");

		}else if(eventID.equals(EventIDList.IZM0091D004)){
			/** 住所対象番号区画適用終了日変更振舞内部 */
			int Rtn = 0;
			Rtn = execIZM0091D004_3(inETMsg, inContext, "WC");

		}else if(eventID.equals(EventIDList.IZM0091D005)){
			/** 住所対象番号区画登録振舞内部 */
			int Rtn = 0;
			Rtn = execIZM0091D005_3(inETMsg, inContext, "WC");

		}

		JSYejbLog.println(JSYejbLog.DEBUG, getClass(), "end:JSYejbZM0081KRCK.invoke");

	}

	/**
	 * ICK0011D001_制約ＮＯ5チェック
	 *
	 * @param inETMsg チェック対象のETMsg(CK0011ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execICK0011D001_5(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(CK0011ETMsg.KEISHA_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(CK0011ETMsg.KEISHA_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(CK0011ETMsg.KEISHA_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(CK0011ETMsg.KEISHA_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(CK0011ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(CK0011ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(CK0011ETMsg.STATUS)) {
			inETMsg.set(CK0011ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * ICK0011D001_制約ＮＯ8チェック
	 *
	 * @param inETMsg チェック対象のETMsg(CK0011ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execICK0011D001_8(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(CK0011ETMsg.CONT_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(CK0011ETMsg.CONT_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(CK0011ETMsg.CONT_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(CK0011ETMsg.CONT_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(CK0011ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(CK0011ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(CK0011ETMsg.STATUS)) {
			inETMsg.set(CK0011ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * ICK0011D002_制約ＮＯ3チェック
	 *
	 * @param inETMsg チェック対象のETMsg(CK0011ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execICK0011D002_3(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(CK0011ETMsg.KEISHA_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(CK0011ETMsg.KEISHA_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(CK0011ETMsg.KEISHA_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(CK0011ETMsg.KEISHA_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(CK0011ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(CK0011ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(CK0011ETMsg.STATUS)) {
			inETMsg.set(CK0011ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * ICK0011D002_制約ＮＯ4チェック
	 *
	 * @param inETMsg チェック対象のETMsg(CK0011ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execICK0011D002_4(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(CK0011ETMsg.CONT_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(CK0011ETMsg.CONT_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(CK0011ETMsg.CONT_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(CK0011ETMsg.CONT_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(CK0011ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(CK0011ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(CK0011ETMsg.STATUS)) {
			inETMsg.set(CK0011ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * ICK0011D002_制約ＮＯ6チェック
	 *
	 * @param inETMsg チェック対象のETMsg(CK0011ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execICK0011D002_6(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(CK0011ETMsg.CSSTI_SHS_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(CK0011ETMsg.CSSTI_SHS_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(CK0011ETMsg.CSSTI_SHS_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(CK0011ETMsg.CSSTI_SHS_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(CK0011ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(CK0011ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(CK0011ETMsg.STATUS)) {
			inETMsg.set(CK0011ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * ICK0011D003_制約ＮＯ5チェック
	 *
	 * @param inETMsg チェック対象のETMsg(CK0011ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execICK0011D003_5(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(CK0011ETMsg.KEISHA_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(CK0011ETMsg.KEISHA_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(CK0011ETMsg.KEISHA_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(CK0011ETMsg.KEISHA_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(CK0011ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(CK0011ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(CK0011ETMsg.STATUS)) {
			inETMsg.set(CK0011ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * ICK0011D003_制約ＮＯ6チェック
	 *
	 * @param inETMsg チェック対象のETMsg(CK0011ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execICK0011D003_6(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(CK0011ETMsg.CONT_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(CK0011ETMsg.CONT_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(CK0011ETMsg.CONT_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(CK0011ETMsg.CONT_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(CK0011ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(CK0011ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(CK0011ETMsg.STATUS)) {
			inETMsg.set(CK0011ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * ICK0011D008_制約ＮＯ3チェック
	 *
	 * @param inETMsg チェック対象のETMsg(CK0011ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execICK0011D008_3(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(CK0011ETMsg.KEISHA_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(CK0011ETMsg.KEISHA_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(CK0011ETMsg.KEISHA_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(CK0011ETMsg.KEISHA_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(CK0011ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(CK0011ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(CK0011ETMsg.STATUS)) {
			inETMsg.set(CK0011ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * ICK0011D008_制約ＮＯ4チェック
	 *
	 * @param inETMsg チェック対象のETMsg(CK0011ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execICK0011D008_4(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(CK0011ETMsg.CONT_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(CK0011ETMsg.CONT_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(CK0011ETMsg.CONT_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(CK0011ETMsg.CONT_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(CK0011ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(CK0011ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(CK0011ETMsg.STATUS)) {
			inETMsg.set(CK0011ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * ICK0011D008_制約ＮＯ6チェック
	 *
	 * @param inETMsg チェック対象のETMsg(CK0011ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execICK0011D008_6(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(CK0011ETMsg.CSSTI_SHS_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(CK0011ETMsg.CSSTI_SHS_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(CK0011ETMsg.CSSTI_SHS_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(CK0011ETMsg.CSSTI_SHS_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(CK0011ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(CK0011ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(CK0011ETMsg.STATUS)) {
			inETMsg.set(CK0011ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * ICK0011D016_制約ＮＯ3チェック
	 *
	 * @param inETMsg チェック対象のETMsg(CK0011ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execICK0011D016_3(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(CK0011ETMsg.KEISHA_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(CK0011ETMsg.KEISHA_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(CK0011ETMsg.KEISHA_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(CK0011ETMsg.KEISHA_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(CK0011ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(CK0011ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(CK0011ETMsg.STATUS)) {
			inETMsg.set(CK0011ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * ICK0011D016_制約ＮＯ4チェック
	 *
	 * @param inETMsg チェック対象のETMsg(CK0011ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execICK0011D016_4(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(CK0011ETMsg.CONT_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(CK0011ETMsg.CONT_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(CK0011ETMsg.CONT_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(CK0011ETMsg.CONT_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(CK0011ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(CK0011ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(CK0011ETMsg.STATUS)) {
			inETMsg.set(CK0011ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * ICK0011D023_制約ＮＯ3チェック
	 *
	 * @param inETMsg チェック対象のETMsg(CK0011ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execICK0011D023_3(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(CK0011ETMsg.KEISHA_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(CK0011ETMsg.KEISHA_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(CK0011ETMsg.KEISHA_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(CK0011ETMsg.KEISHA_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(CK0011ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(CK0011ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(CK0011ETMsg.STATUS)) {
			inETMsg.set(CK0011ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * ICK0011D023_制約ＮＯ4チェック
	 *
	 * @param inETMsg チェック対象のETMsg(CK0011ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execICK0011D023_4(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(CK0011ETMsg.CONT_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(CK0011ETMsg.CONT_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(CK0011ETMsg.CONT_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(CK0011ETMsg.CONT_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(CK0011ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(CK0011ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(CK0011ETMsg.STATUS)) {
			inETMsg.set(CK0011ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * ICK0011D023_制約ＮＯ5チェック
	 *
	 * @param inETMsg チェック対象のETMsg(CK0011ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execICK0011D023_5(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(CK0011ETMsg.CSSTI_SHS_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(CK0011ETMsg.CSSTI_SHS_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(CK0011ETMsg.CSSTI_SHS_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(CK0011ETMsg.CSSTI_SHS_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(CK0011ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(CK0011ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(CK0011ETMsg.STATUS)) {
			inETMsg.set(CK0011ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * ICK0021D001_制約ＮＯ3チェック
	 *
	 * @param inETMsg チェック対象のETMsg(CK0021ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execICK0021D001_3(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(CK0021ETMsg.OFFC_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(CK0021ETMsg.OFFC_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(CK0021ETMsg.OFFC_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(CK0021ETMsg.OFFC_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(CK0021ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(CK0021ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(CK0021ETMsg.STATUS)) {
			inETMsg.set(CK0021ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * ICK0021D001_制約ＮＯ4チェック
	 *
	 * @param inETMsg チェック対象のETMsg(CK0021ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execICK0021D001_4(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(CK0021ETMsg.SKSHA_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(CK0021ETMsg.SKSHA_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(CK0021ETMsg.SKSHA_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(CK0021ETMsg.SKSHA_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(CK0021ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(CK0021ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(CK0021ETMsg.STATUS)) {
			inETMsg.set(CK0021ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * ICK0021D002_制約ＮＯ3チェック
	 *
	 * @param inETMsg チェック対象のETMsg(CK0021ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execICK0021D002_3(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(CK0021ETMsg.OFFC_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(CK0021ETMsg.OFFC_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(CK0021ETMsg.OFFC_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(CK0021ETMsg.OFFC_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(CK0021ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(CK0021ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(CK0021ETMsg.STATUS)) {
			inETMsg.set(CK0021ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * ICK0021D002_制約ＮＯ4チェック
	 *
	 * @param inETMsg チェック対象のETMsg(CK0021ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execICK0021D002_4(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(CK0021ETMsg.SKSHA_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(CK0021ETMsg.SKSHA_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(CK0021ETMsg.SKSHA_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(CK0021ETMsg.SKSHA_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(CK0021ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(CK0021ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(CK0021ETMsg.STATUS)) {
			inETMsg.set(CK0021ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * ICK0021D004_制約ＮＯ2チェック
	 *
	 * @param inETMsg チェック対象のETMsg(CK0021ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execICK0021D004_2(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(CK0021ETMsg.OFFC_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(CK0021ETMsg.OFFC_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(CK0021ETMsg.OFFC_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(CK0021ETMsg.OFFC_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(CK0021ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(CK0021ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(CK0021ETMsg.STATUS)) {
			inETMsg.set(CK0021ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * ICK0021D004_制約ＮＯ3チェック
	 *
	 * @param inETMsg チェック対象のETMsg(CK0021ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execICK0021D004_3(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(CK0021ETMsg.SKSHA_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(CK0021ETMsg.SKSHA_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(CK0021ETMsg.SKSHA_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(CK0021ETMsg.SKSHA_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(CK0021ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(CK0021ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(CK0021ETMsg.STATUS)) {
			inETMsg.set(CK0021ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * ICK0041D001_制約ＮＯ2チェック
	 *
	 * @param inETMsg チェック対象のETMsg(CK0041ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execICK0041D001_2(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(CK0041ETMsg.HJRRKS_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(CK0041ETMsg.HJRRKS_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(CK0041ETMsg.HJRRKS_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(CK0041ETMsg.HJRRKS_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(CK0041ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(CK0041ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(CK0041ETMsg.STATUS)) {
			inETMsg.set(CK0041ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * ICK0041D003_制約ＮＯ4チェック
	 *
	 * @param inETMsg チェック対象のETMsg(CK0041ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execICK0041D003_4(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(CK0041ETMsg.HJRRKS_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(CK0041ETMsg.HJRRKS_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(CK0041ETMsg.HJRRKS_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(CK0041ETMsg.HJRRKS_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(CK0041ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(CK0041ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(CK0041ETMsg.STATUS)) {
			inETMsg.set(CK0041ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * ICK0041D004_制約ＮＯ3チェック
	 *
	 * @param inETMsg チェック対象のETMsg(CK0041ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execICK0041D004_3(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(CK0041ETMsg.HJRRKS_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(CK0041ETMsg.HJRRKS_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(CK0041ETMsg.HJRRKS_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(CK0041ETMsg.HJRRKS_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(CK0041ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(CK0041ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(CK0041ETMsg.STATUS)) {
			inETMsg.set(CK0041ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * ICK0041D005_制約ＮＯ2チェック
	 *
	 * @param inETMsg チェック対象のETMsg(CK0041ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execICK0041D005_2(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(CK0041ETMsg.HJRRKS_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(CK0041ETMsg.HJRRKS_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(CK0041ETMsg.HJRRKS_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(CK0041ETMsg.HJRRKS_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(CK0041ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(CK0041ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(CK0041ETMsg.STATUS)) {
			inETMsg.set(CK0041ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * ICK0051C001_制約ＮＯ2チェック
	 *
	 * @param inETMsg チェック対象のETMsg(CK0051ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execICK0051C001_2(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(CK0051ETMsg.PROSCST_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(CK0051ETMsg.PROSCST_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(CK0051ETMsg.PROSCST_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(CK0051ETMsg.PROSCST_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(CK0051ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(CK0051ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(CK0051ETMsg.STATUS)) {
			inETMsg.set(CK0051ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * ICK0051D001_制約ＮＯ2チェック
	 *
	 * @param inETMsg チェック対象のETMsg(CK0051ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execICK0051D001_2(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(CK0051ETMsg.PROSCST_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(CK0051ETMsg.PROSCST_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(CK0051ETMsg.PROSCST_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(CK0051ETMsg.PROSCST_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(CK0051ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(CK0051ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(CK0051ETMsg.STATUS)) {
			inETMsg.set(CK0051ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * ICK0061C003_制約ＮＯ2チェック
	 *
	 * @param inETMsg チェック対象のETMsg(CK0061ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execICK0061C003_2(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(CK0061ETMsg.HURYO_CUST_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(CK0061ETMsg.HURYO_CUST_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(CK0061ETMsg.HURYO_CUST_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(CK0061ETMsg.HURYO_CUST_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(CK0061ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(CK0061ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(CK0061ETMsg.STATUS)) {
			inETMsg.set(CK0061ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * ICK0061D001_制約ＮＯ6チェック
	 *
	 * @param inETMsg チェック対象のETMsg(CK0061ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execICK0061D001_6(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(CK0061ETMsg.HURYO_CUST_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(CK0061ETMsg.HURYO_CUST_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(CK0061ETMsg.HURYO_CUST_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(CK0061ETMsg.HURYO_CUST_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(CK0061ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(CK0061ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(CK0061ETMsg.STATUS)) {
			inETMsg.set(CK0061ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0061D001_制約ＮＯ4チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0061ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0061D001_4(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0061ETMsg.AGNT_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0061ETMsg.AGNT_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0061ETMsg.AGNT_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0061ETMsg.AGNT_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0061ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0061ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0061ETMsg.STATUS)) {
			inETMsg.set(KK0061ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0061D002_制約ＮＯ4チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0061ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0061D002_4(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0061ETMsg.AGNT_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0061ETMsg.AGNT_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0061ETMsg.AGNT_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0061ETMsg.AGNT_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0061ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0061ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0061ETMsg.STATUS)) {
			inETMsg.set(KK0061ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0191D003_制約ＮＯ4チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0191ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0191D003_4(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0191ETMsg.EMG_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0191ETMsg.EMG_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0191ETMsg.EMG_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0191ETMsg.EMG_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0191ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0191ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0191ETMsg.STATUS)) {
			inETMsg.set(KK0191ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0191D003_制約ＮＯ5チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0191ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0191D003_5(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0191ETMsg.NTT_KEISHA_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0191ETMsg.NTT_KEISHA_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0191ETMsg.NTT_KEISHA_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0191ETMsg.NTT_KEISHA_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0191ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0191ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0191ETMsg.STATUS)) {
			inETMsg.set(KK0191ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0191D006_制約ＮＯ2チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0191ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0191D006_2(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0191ETMsg.EMG_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0191ETMsg.EMG_AD_CD).toString());
			}

			String joken3_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_3 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken3_2 == null){
				joken_3 += " IS NULL ";
			}else{
				joken_3 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0191ETMsg.EMG_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_3 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken3_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken3_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0191ETMsg.EMG_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0191ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0191ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0191ETMsg.STATUS)) {
			inETMsg.set(KK0191ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0191D012_制約ＮＯ2チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0191ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0191D012_2(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// 制約部品引数定義
			Object joken_3_prm_1 = null;
			if(!inETMsg.isNull(KK0191ETMsg.SVC_KEI_UCWK_NO)){
				joken_3_prm_1 = inETMsg.getObject(KK0191ETMsg.SVC_KEI_UCWK_NO);
			}

			Object joken_3_prm_2 = null;
			if(!inETMsg.isNull(KK0191ETMsg.NTT_KEISHA_AD_CD)){
				joken_3_prm_2 = inETMsg.getObject(KK0191ETMsg.NTT_KEISHA_AD_CD);
			}

			Object joken_3_prm_3 = null;
			if(!inETMsg.isNull(KK0191ETMsg.NTT_KEISHA_PCD)){
				joken_3_prm_3 = inETMsg.getObject(KK0191ETMsg.NTT_KEISHA_PCD);
			}

			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0191ETMsg.NTT_KEISHA_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0191ETMsg.NTT_KEISHA_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (JKKModelCommon.isNttKeishaAdChgKK0191(inETMsg, inContext, joken_3_prm_1, joken_3_prm_2, joken_3_prm_3 ) == true) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0191ETMsg.NTT_KEISHA_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0191ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0191ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0191ETMsg.STATUS)) {
			inETMsg.set(KK0191ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0191D012_制約ＮＯ3チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0191ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0191D012_3(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0191ETMsg.EMG_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0191ETMsg.EMG_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0191ETMsg.EMG_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0191ETMsg.EMG_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0191ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0191ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0191ETMsg.STATUS)) {
			inETMsg.set(KK0191ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0191D015_制約ＮＯ2チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0191ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0191D015_2(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0191ETMsg.EMG_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0191ETMsg.EMG_AD_CD).toString());
			}

			String joken3_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_3 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken3_2 == null){
				joken_3 += " IS NULL ";
			}else{
				joken_3 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0191ETMsg.EMG_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_3 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken3_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken3_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0191ETMsg.EMG_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0191ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0191ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0191ETMsg.STATUS)) {
			inETMsg.set(KK0191ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0251D002_制約ＮＯ4チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0251ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0251D002_4(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0251ETMsg.KAISEN_PLACE_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0251ETMsg.KAISEN_PLACE_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0251ETMsg.KAISEN_PLACE_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0251ETMsg.KAISEN_PLACE_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0251ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0251ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0251ETMsg.STATUS)) {
			inETMsg.set(KK0251ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0251D005_制約ＮＯ4チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0251ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0251D005_4(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0251ETMsg.KAISEN_PLACE_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0251ETMsg.KAISEN_PLACE_AD_CD).toString());
			}

			String joken3_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_3 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken3_2 == null){
				joken_3 += " IS NULL ";
			}else{
				joken_3 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0251ETMsg.KAISEN_PLACE_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_3 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken3_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken3_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0251ETMsg.KAISEN_PLACE_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0251ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0251ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0251ETMsg.STATUS)) {
			inETMsg.set(KK0251ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0251D010_制約ＮＯ4チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0251ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0251D010_4(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0251ETMsg.KAISEN_PLACE_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0251ETMsg.KAISEN_PLACE_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0251ETMsg.KAISEN_PLACE_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0251ETMsg.KAISEN_PLACE_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0251ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0251ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0251ETMsg.STATUS)) {
			inETMsg.set(KK0251ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0341C010_制約ＮＯ2チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0341ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0341C010_2(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// 制約部品引数定義
			Object joken_3_prm_1 = null;
			if(!inETMsg.isNull(KK0341ETMsg.KKTK_SVC_KEI_NO)){
				joken_3_prm_1 = inETMsg.getObject(KK0341ETMsg.KKTK_SVC_KEI_NO);
			}

			Object joken_3_prm_2 = null;
			if(!inETMsg.isNull(KK0341ETMsg.KIKI_SOHUS_AD_CD)){
				joken_3_prm_2 = inETMsg.getObject(KK0341ETMsg.KIKI_SOHUS_AD_CD);
			}

			Object joken_3_prm_3 = null;
			if(!inETMsg.isNull(KK0341ETMsg.KIKI_SOHUS_PCD)){
				joken_3_prm_3 = inETMsg.getObject(KK0341ETMsg.KIKI_SOHUS_PCD);
			}

			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0341ETMsg.KIKI_SOHUS_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0341ETMsg.KIKI_SOHUS_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (JKKModelCommon.isKikiSohusAdChgKK0341(inETMsg, inContext, joken_3_prm_1, joken_3_prm_2, joken_3_prm_3 ) == true) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0341ETMsg.KIKI_SOHUS_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0341ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0341ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0341ETMsg.STATUS)) {
			inETMsg.set(KK0341ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0341C016_制約ＮＯ8チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0341ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0341C016_8(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

			// 制約部品引数定義
			Object joken_2_prm_1 = null;
			if(!inETMsg.isNull(KK0341ETMsg.KKTK_SVC_KEI_NO)){
				joken_2_prm_1 = inETMsg.getObject(KK0341ETMsg.KKTK_SVC_KEI_NO);
			}

			Object joken_2_prm_2 = null;
			if(!inETMsg.isNull(KK0341ETMsg.KIKI_SOHUS_AD_CD)){
				joken_2_prm_2 = inETMsg.getObject(KK0341ETMsg.KIKI_SOHUS_AD_CD);
			}

			Object joken_2_prm_3 = null;
			if(!inETMsg.isNull(KK0341ETMsg.KIKI_SOHUS_PCD)){
				joken_2_prm_3 = inETMsg.getObject(KK0341ETMsg.KIKI_SOHUS_PCD);
			}

			Object joken_1_prm_1 = null;
			if(!inETMsg.isNull(KK0341ETMsg.KIKI_SOHUS_AD_CD)){
				joken_1_prm_1 = inETMsg.getObject(KK0341ETMsg.KIKI_SOHUS_AD_CD);
			}

			// チェック条件
			if (JKKModelCommon.isKikiSohusAdChgKK0341(inETMsg, inContext, joken_2_prm_1, joken_2_prm_2, joken_2_prm_3 ) == true) { 
			// 判定条件
			if(JKKModelCommon.isAddCdExistenceChk(inETMsg, inContext, joken_1_prm_1 ) == false){
					inETMsg.set(KK0341ETMsg.KIKI_SOHUS_AD_CD_ERR, errFlag);
					if("W".equals(errFlag.substring(0,1))){
						rtn = StatusCodes.WARNING;
					} else {
						rtn = StatusCodes.RELATION_ERR;
					}
				}
			}

		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0341ETMsg.STATUS)) {
			inETMsg.set(KK0341ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0341C023_制約ＮＯ2チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0341ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0341C023_2(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

			// チェック条件定数
			// 制約部品引数定義
			Object joken_1_prm_1 = null;
			if(!inETMsg.isNull(KK0341ETMsg.KIKI_STC_SAKI_AD_CD)){
				joken_1_prm_1 = inETMsg.getObject(KK0341ETMsg.KIKI_STC_SAKI_AD_CD);
			}

			// チェック条件
			if (!inETMsg.isNull(KK0341ETMsg.KIKI_STC_SAKI_AD_CD)) { 
			// 判定条件
			if(JKKModelCommon.isAddCdExistenceChk(inETMsg, inContext, joken_1_prm_1 ) == false){
					inETMsg.set(KK0341ETMsg.KIKI_STC_SAKI_AD_CD_ERR, errFlag);
					if("W".equals(errFlag.substring(0,1))){
						rtn = StatusCodes.WARNING;
					} else {
						rtn = StatusCodes.RELATION_ERR;
					}
				}
			}

		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0341ETMsg.STATUS)) {
			inETMsg.set(KK0341ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0341D002_制約ＮＯ12チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0341ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0341D002_12(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0341ETMsg.KIKI_SOHUS_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0341ETMsg.KIKI_SOHUS_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0341ETMsg.KIKI_SOHUS_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0341ETMsg.KIKI_SOHUS_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0341ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0341ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0341ETMsg.STATUS)) {
			inETMsg.set(KK0341ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0341D002_制約ＮＯ13チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0341ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0341D002_13(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0341ETMsg.KIKI_STC_SAKI_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0341ETMsg.KIKI_STC_SAKI_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0341ETMsg.KIKI_STC_SAKI_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0341ETMsg.KIKI_STC_SAKI_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0341ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0341ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0341ETMsg.STATUS)) {
			inETMsg.set(KK0341ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0341D004_制約ＮＯ12チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0341ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0341D004_12(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

			// 制約部品引数定義
			Object joken_2_prm_1 = null;
			if(!inETMsg.isNull(KK0341ETMsg.KKTK_SVC_KEI_NO)){
				joken_2_prm_1 = inETMsg.getObject(KK0341ETMsg.KKTK_SVC_KEI_NO);
			}

			Object joken_2_prm_2 = null;
			if(!inETMsg.isNull(KK0341ETMsg.KIKI_SOHUS_AD_CD)){
				joken_2_prm_2 = inETMsg.getObject(KK0341ETMsg.KIKI_SOHUS_AD_CD);
			}

			Object joken_2_prm_3 = null;
			if(!inETMsg.isNull(KK0341ETMsg.KIKI_SOHUS_PCD)){
				joken_2_prm_3 = inETMsg.getObject(KK0341ETMsg.KIKI_SOHUS_PCD);
			}

			Object joken_1_prm_1 = null;
			if(!inETMsg.isNull(KK0341ETMsg.KIKI_SOHUS_AD_CD)){
				joken_1_prm_1 = inETMsg.getObject(KK0341ETMsg.KIKI_SOHUS_AD_CD);
			}

			// チェック条件
			if (JKKModelCommon.isKikiSohusAdChgKK0341(inETMsg, inContext, joken_2_prm_1, joken_2_prm_2, joken_2_prm_3 ) == true) { 
			// 判定条件
			if(JKKModelCommon.isAddCdExistenceChk(inETMsg, inContext, joken_1_prm_1 ) == false){
					inETMsg.set(KK0341ETMsg.KIKI_SOHUS_AD_CD_ERR, errFlag);
					if("W".equals(errFlag.substring(0,1))){
						rtn = StatusCodes.WARNING;
					} else {
						rtn = StatusCodes.RELATION_ERR;
					}
				}
			}

		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0341ETMsg.STATUS)) {
			inETMsg.set(KK0341ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0341D004_制約ＮＯ13チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0341ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0341D004_13(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

			// チェック条件定数
			// 制約部品引数定義
			Object joken_1_prm_1 = null;
			if(!inETMsg.isNull(KK0341ETMsg.KIKI_STC_SAKI_AD_CD)){
				joken_1_prm_1 = inETMsg.getObject(KK0341ETMsg.KIKI_STC_SAKI_AD_CD);
			}

			// チェック条件
			if (!inETMsg.isNull(KK0341ETMsg.KIKI_STC_SAKI_AD_CD)) { 
			// 判定条件
			if(JKKModelCommon.isAddCdExistenceChk(inETMsg, inContext, joken_1_prm_1 ) == false){
					inETMsg.set(KK0341ETMsg.KIKI_STC_SAKI_AD_CD_ERR, errFlag);
					if("W".equals(errFlag.substring(0,1))){
						rtn = StatusCodes.WARNING;
					} else {
						rtn = StatusCodes.RELATION_ERR;
					}
				}
			}

		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0341ETMsg.STATUS)) {
			inETMsg.set(KK0341ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0341D037_制約ＮＯ3チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0341ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0341D037_3(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// 制約部品引数定義
			Object joken_3_prm_1 = null;
			if(!inETMsg.isNull(KK0341ETMsg.KKTK_SVC_KEI_NO)){
				joken_3_prm_1 = inETMsg.getObject(KK0341ETMsg.KKTK_SVC_KEI_NO);
			}

			Object joken_3_prm_2 = null;
			if(!inETMsg.isNull(KK0341ETMsg.KIKI_SOHUS_AD_CD)){
				joken_3_prm_2 = inETMsg.getObject(KK0341ETMsg.KIKI_SOHUS_AD_CD);
			}

			Object joken_3_prm_3 = null;
			if(!inETMsg.isNull(KK0341ETMsg.KIKI_SOHUS_PCD)){
				joken_3_prm_3 = inETMsg.getObject(KK0341ETMsg.KIKI_SOHUS_PCD);
			}

			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0341ETMsg.KIKI_SOHUS_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0341ETMsg.KIKI_SOHUS_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (JKKModelCommon.isKikiSohusAdChgKK0341(inETMsg, inContext, joken_3_prm_1, joken_3_prm_2, joken_3_prm_3 ) == true) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0341ETMsg.KIKI_SOHUS_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0341ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0341ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0341ETMsg.STATUS)) {
			inETMsg.set(KK0341ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0341D037_制約ＮＯ6チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0341ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0341D037_6(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0341ETMsg.KIKI_STC_SAKI_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0341ETMsg.KIKI_STC_SAKI_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0341ETMsg.KIKI_STC_SAKI_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0341ETMsg.KIKI_STC_SAKI_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0341ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0341ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0341ETMsg.STATUS)) {
			inETMsg.set(KK0341ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0381D001_制約ＮＯ2チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0381ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0381D001_2(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0381ETMsg.GUIDEMG_SOHUS_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0381ETMsg.GUIDEMG_SOHUS_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0381ETMsg.GUIDEMG_SOHUS_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0381ETMsg.GUIDEMG_SOHUS_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0381ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0381ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0381ETMsg.STATUS)) {
			inETMsg.set(KK0381ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0381D004_制約ＮＯ2チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0381ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0381D004_2(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0381ETMsg.GUIDEMG_SOHUS_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0381ETMsg.GUIDEMG_SOHUS_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0381ETMsg.GUIDEMG_SOHUS_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0381ETMsg.GUIDEMG_SOHUS_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0381ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0381ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0381ETMsg.STATUS)) {
			inETMsg.set(KK0381ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0491D001_制約ＮＯ7チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0491ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0491D001_7(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0491ETMsg.SOHUS_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0491ETMsg.SOHUS_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0491ETMsg.SOHUS_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0491ETMsg.SOHUS_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0491ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0491ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0491ETMsg.STATUS)) {
			inETMsg.set(KK0491ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0491D003_制約ＮＯ3チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0491ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0491D003_3(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0491ETMsg.SOHUS_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0491ETMsg.SOHUS_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0491ETMsg.SOHUS_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0491ETMsg.SOHUS_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0491ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0491ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0491ETMsg.STATUS)) {
			inETMsg.set(KK0491ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0491D006_制約ＮＯ6チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0491ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0491D006_6(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0491ETMsg.SOHUS_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0491ETMsg.SOHUS_AD_CD).toString());
			}

			String joken3_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_3 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken3_2 == null){
				joken_3 += " IS NULL ";
			}else{
				joken_3 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0491ETMsg.SOHUS_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_3 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken3_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken3_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0491ETMsg.SOHUS_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0491ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0491ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0491ETMsg.STATUS)) {
			inETMsg.set(KK0491ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0561D001_制約ＮＯ3チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0561ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0561D001_3(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0561ETMsg.TCHISHO_SOHUS_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0561ETMsg.TCHISHO_SOHUS_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0561ETMsg.TCHISHO_SOHUS_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0561ETMsg.TCHISHO_SOHUS_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0561ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0561ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0561ETMsg.STATUS)) {
			inETMsg.set(KK0561ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0581C001_制約ＮＯ2チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0581ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0581C001_2(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0581ETMsg.DMPS_KIINSHA_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0581ETMsg.DMPS_KIINSHA_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0581ETMsg.DMPS_KIINSHA_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0581ETMsg.DMPS_KIINSHA_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0581ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0581ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0581ETMsg.STATUS)) {
			inETMsg.set(KK0581ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0581D001_制約ＮＯ2チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0581ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0581D001_2(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK0581ETMsg.DMPS_KIINSHA_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(KK0581ETMsg.DMPS_KIINSHA_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK0581ETMsg.DMPS_KIINSHA_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK0581ETMsg.DMPS_KIINSHA_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK0581ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK0581ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0581ETMsg.STATUS)) {
			inETMsg.set(KK0581ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK0931D001_制約ＮＯ6チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK0931ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK0931D001_6(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

			// チェック条件定数
			// 制約部品引数定義
			// チェック条件
			if (!inETMsg.isNull(KK0931ETMsg.SVTA_KKKU_TG_PCD)) { 
			// 判定条件
			if(JKKModelCommon.isSvtaKkkuTgPcdKK0931(inETMsg, inContext ) == false){
					inETMsg.set(KK0931ETMsg.SVTA_KKKU_TG_PCD_ERR, errFlag);
					if("W".equals(errFlag.substring(0,1))){
						rtn = StatusCodes.WARNING;
					} else {
						rtn = StatusCodes.RELATION_ERR;
					}
				}
			}

		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK0931ETMsg.STATUS)) {
			inETMsg.set(KK0931ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK1951C001_制約ＮＯ4チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK1951ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK1951C001_4(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK1951ETMsg.DOBANITEN_SK_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(KK1951ETMsg.DOBANITEN_SK_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK1951ETMsg.DOBANITEN_SK_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK1951ETMsg.DOBANITEN_SK_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK1951ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK1951ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK1951ETMsg.STATUS)) {
			inETMsg.set(KK1951ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK1951D001_制約ＮＯ4チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK1951ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK1951D001_4(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK1951ETMsg.NTT_KEISHA_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(KK1951ETMsg.NTT_KEISHA_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK1951ETMsg.NTT_KEISHA_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK1951ETMsg.NTT_KEISHA_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK1951ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK1951ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK1951ETMsg.STATUS)) {
			inETMsg.set(KK1951ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK1951D001_制約ＮＯ5チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK1951ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK1951D001_5(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK1951ETMsg.DOBANITEN_SK_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(KK1951ETMsg.DOBANITEN_SK_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK1951ETMsg.DOBANITEN_SK_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK1951ETMsg.DOBANITEN_SK_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK1951ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK1951ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK1951ETMsg.STATUS)) {
			inETMsg.set(KK1951ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK2691C001_制約ＮＯ3チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK2691ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK2691C001_3(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK2691ETMsg.MAP_CUST_PST_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(KK2691ETMsg.MAP_CUST_PST_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK2691ETMsg.MAP_CUST_PST_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK2691ETMsg.MAP_CUST_PST_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK2691ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK2691ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK2691ETMsg.STATUS)) {
			inETMsg.set(KK2691ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK2691D001_制約ＮＯ3チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK2691ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK2691D001_3(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK2691ETMsg.MAP_CUST_PST_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(KK2691ETMsg.MAP_CUST_PST_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK2691ETMsg.MAP_CUST_PST_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK2691ETMsg.MAP_CUST_PST_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK2691ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK2691ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK2691ETMsg.STATUS)) {
			inETMsg.set(KK2691ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IKK3011D001_制約ＮＯ4チェック
	 *
	 * @param inETMsg チェック対象のETMsg(KK3011ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIKK3011D001_4(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// チェック条件定数
			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(KK3011ETMsg.KNYTCS_SOHUS_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(KK3011ETMsg.KNYTCS_SOHUS_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}

			// チェック条件
			if (!inETMsg.isNull(KK3011ETMsg.KNYTCS_SOHUS_AD_CD)) { 

				// ＳＱＬ文の組み立て
				sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
					.append("(" + joken_1 + " AND " + joken_2 + " ) ");

				// ＳＱＬ文の解析
				pstmtQuery = con.prepareStatement(sqlQuery.toString());

				// パラメータの設定
				int para_idx = 1;
				if(joken1_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
				}
				if(joken2_2 != null){
					CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
				}

				// ＳＱＬ文の実行
				rsltQuery = pstmtQuery.executeQuery();

				if(rsltQuery.next()){
				// 判定条件
					if(!(rsltQuery.getLong("CNT")>0)){
						inETMsg.set(KK3011ETMsg.KNYTCS_SOHUS_AD_CD_ERR, errFlag);
						if("W".equals(errFlag.substring(0,1))){
							rtn = StatusCodes.WARNING;
						} else {
							rtn = StatusCodes.RELATION_ERR;
						}
					}
				}

			}

		} catch(SQLException e) {
			inETMsg.set(KK3011ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(KK3011ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(KK3011ETMsg.STATUS)) {
			inETMsg.set(KK3011ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * ITU0011C002_制約ＮＯ12チェック
	 *
	 * @param inETMsg チェック対象のETMsg(TU0011ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execITU0011C002_12(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

			// チェック条件定数
			String joken4_1 = new String();
			if(!inETMsg.isNull(TU0011ETMsg.NKYS_AD_MAN_INPUT_FLG)){
				joken4_1 = inETMsg.getObject(TU0011ETMsg.NKYS_AD_MAN_INPUT_FLG).toString();
			}

			String joken4_2 = "0";

			// 制約部品引数定義
			Object joken_1_prm_1 = null;
			if(!inETMsg.isNull(TU0011ETMsg.NTT_KEISHA_AD_CD)){
				joken_1_prm_1 = inETMsg.getObject(TU0011ETMsg.NTT_KEISHA_AD_CD);
			}

			Object joken_1_prm_2 = null;
			if(!inETMsg.isNull(TU0011ETMsg.NTT_KEISHA_PCD)){
				joken_1_prm_2 = inETMsg.getObject(TU0011ETMsg.NTT_KEISHA_PCD);
			}

			// チェック条件
			if ((!inETMsg.isNull(TU0011ETMsg.NTT_KEISHA_AD_CD) && !inETMsg.isNull(TU0011ETMsg.NTT_KEISHA_PCD)) && joken4_1.compareTo(joken4_2) == 0) { 
			// 判定条件
			if(!(JTUejbZM0081KRCK.isAdCdExistsCheck002(inETMsg, inContext, joken_1_prm_1, joken_1_prm_2 ) == true)){
					inETMsg.set(TU0011ETMsg.NTT_KEISHA_PCD_ERR, errFlag);
					if("W".equals(errFlag.substring(0,1))){
						rtn = StatusCodes.WARNING;
					} else {
						rtn = StatusCodes.RELATION_ERR;
					}
				}
			}

		
		// ステータスのセット
		if (rtn > inETMsg.getInt(TU0011ETMsg.STATUS)) {
			inETMsg.set(TU0011ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * ITU0011C002_制約ＮＯ13チェック
	 *
	 * @param inETMsg チェック対象のETMsg(TU0011ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execITU0011C002_13(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

			// チェック条件定数
			String joken4_1 = new String();
			if(!inETMsg.isNull(TU0011ETMsg.SETPLACE_AD_MAN_INPUT_FLG)){
				joken4_1 = inETMsg.getObject(TU0011ETMsg.SETPLACE_AD_MAN_INPUT_FLG).toString();
			}

			String joken4_2 = "0";

			// 制約部品引数定義
			Object joken_1_prm_1 = null;
			if(!inETMsg.isNull(TU0011ETMsg.SETPLACE_AD_CD)){
				joken_1_prm_1 = inETMsg.getObject(TU0011ETMsg.SETPLACE_AD_CD);
			}

			Object joken_1_prm_2 = null;
			if(!inETMsg.isNull(TU0011ETMsg.SETPLACE_PCD)){
				joken_1_prm_2 = inETMsg.getObject(TU0011ETMsg.SETPLACE_PCD);
			}

			// チェック条件
			if ((!inETMsg.isNull(TU0011ETMsg.SETPLACE_AD_CD) && !inETMsg.isNull(TU0011ETMsg.SETPLACE_PCD)) && joken4_1.compareTo(joken4_2) == 0) { 
			// 判定条件
			if(!(JTUejbZM0081KRCK.isAdCdExistsCheck001(inETMsg, inContext, joken_1_prm_1, joken_1_prm_2 ) == true)){
					inETMsg.set(TU0011ETMsg.SETPLACE_PCD_ERR, errFlag);
					if("W".equals(errFlag.substring(0,1))){
						rtn = StatusCodes.WARNING;
					} else {
						rtn = StatusCodes.RELATION_ERR;
					}
				}
			}

		
		// ステータスのセット
		if (rtn > inETMsg.getInt(TU0011ETMsg.STATUS)) {
			inETMsg.set(TU0011ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * ITU0011C002_制約ＮＯ14チェック
	 *
	 * @param inETMsg チェック対象のETMsg(TU0011ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execITU0011C002_14(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

			// チェック条件定数
			String joken4_1 = new String();
			if(!inETMsg.isNull(TU0011ETMsg.KNKN_ITNSAD_MAN_INPUT_FLG)){
				joken4_1 = inETMsg.getObject(TU0011ETMsg.KNKN_ITNSAD_MAN_INPUT_FLG).toString();
			}

			String joken4_2 = "0";

			// 制約部品引数定義
			Object joken_1_prm_1 = null;
			if(!inETMsg.isNull(TU0011ETMsg.KANYKN_ITENS_AD_CD)){
				joken_1_prm_1 = inETMsg.getObject(TU0011ETMsg.KANYKN_ITENS_AD_CD);
			}

			Object joken_1_prm_2 = null;
			if(!inETMsg.isNull(TU0011ETMsg.KANYKN_ITENS_PCD)){
				joken_1_prm_2 = inETMsg.getObject(TU0011ETMsg.KANYKN_ITENS_PCD);
			}

			// チェック条件
			if ((!inETMsg.isNull(TU0011ETMsg.KANYKN_ITENS_AD_CD) && !inETMsg.isNull(TU0011ETMsg.KANYKN_ITENS_PCD)) && joken4_1.compareTo(joken4_2) == 0) { 
			// 判定条件
			if(!(JTUejbZM0081KRCK.isAdCdExistsCheck002(inETMsg, inContext, joken_1_prm_1, joken_1_prm_2 ) == true)){
					inETMsg.set(TU0011ETMsg.KANYKN_ITENS_PCD_ERR, errFlag);
					if("W".equals(errFlag.substring(0,1))){
						rtn = StatusCodes.WARNING;
					} else {
						rtn = StatusCodes.RELATION_ERR;
					}
				}
			}

		
		// ステータスのセット
		if (rtn > inETMsg.getInt(TU0011ETMsg.STATUS)) {
			inETMsg.set(TU0011ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * ITU0011D004_制約ＮＯ1チェック
	 *
	 * @param inETMsg チェック対象のETMsg(TU0011ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execITU0011D004_1(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

			// チェック条件定数
			String joken4_1 = new String();
			if(!inETMsg.isNull(TU0011ETMsg.NKYS_AD_MAN_INPUT_FLG)){
				joken4_1 = inETMsg.getObject(TU0011ETMsg.NKYS_AD_MAN_INPUT_FLG).toString();
			}

			String joken4_2 = "0";

			// 制約部品引数定義
			Object joken_1_prm_1 = null;
			if(!inETMsg.isNull(TU0011ETMsg.NTT_KEISHA_AD_CD)){
				joken_1_prm_1 = inETMsg.getObject(TU0011ETMsg.NTT_KEISHA_AD_CD);
			}

			Object joken_1_prm_2 = null;
			if(!inETMsg.isNull(TU0011ETMsg.NTT_KEISHA_PCD)){
				joken_1_prm_2 = inETMsg.getObject(TU0011ETMsg.NTT_KEISHA_PCD);
			}

			// チェック条件
			if ((!inETMsg.isNull(TU0011ETMsg.NTT_KEISHA_AD_CD) && !inETMsg.isNull(TU0011ETMsg.NTT_KEISHA_PCD)) && joken4_1.compareTo(joken4_2) == 0) { 
			// 判定条件
			if(!(JTUejbZM0081KRCK.isAdCdExistsCheck002(inETMsg, inContext, joken_1_prm_1, joken_1_prm_2 ) == true)){
					inETMsg.set(TU0011ETMsg.NTT_KEISHA_AD_CD_ERR, errFlag);
					if("W".equals(errFlag.substring(0,1))){
						rtn = StatusCodes.WARNING;
					} else {
						rtn = StatusCodes.RELATION_ERR;
					}
				}
			}

		
		// ステータスのセット
		if (rtn > inETMsg.getInt(TU0011ETMsg.STATUS)) {
			inETMsg.set(TU0011ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * ITU0011D004_制約ＮＯ2チェック
	 *
	 * @param inETMsg チェック対象のETMsg(TU0011ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execITU0011D004_2(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

			// チェック条件定数
			String joken4_1 = new String();
			if(!inETMsg.isNull(TU0011ETMsg.SETPLACE_AD_MAN_INPUT_FLG)){
				joken4_1 = inETMsg.getObject(TU0011ETMsg.SETPLACE_AD_MAN_INPUT_FLG).toString();
			}

			String joken4_2 = "0";

			// 制約部品引数定義
			Object joken_1_prm_1 = null;
			if(!inETMsg.isNull(TU0011ETMsg.SETPLACE_AD_CD)){
				joken_1_prm_1 = inETMsg.getObject(TU0011ETMsg.SETPLACE_AD_CD);
			}

			Object joken_1_prm_2 = null;
			if(!inETMsg.isNull(TU0011ETMsg.SETPLACE_PCD)){
				joken_1_prm_2 = inETMsg.getObject(TU0011ETMsg.SETPLACE_PCD);
			}

			// チェック条件
			if ((!inETMsg.isNull(TU0011ETMsg.SETPLACE_AD_CD) && !inETMsg.isNull(TU0011ETMsg.SETPLACE_PCD)) && joken4_1.compareTo(joken4_2) == 0) { 
			// 判定条件
			if(!(JTUejbZM0081KRCK.isAdCdExistsCheck001(inETMsg, inContext, joken_1_prm_1, joken_1_prm_2 ) == true)){
					inETMsg.set(TU0011ETMsg.SETPLACE_AD_CD_ERR, errFlag);
					if("W".equals(errFlag.substring(0,1))){
						rtn = StatusCodes.WARNING;
					} else {
						rtn = StatusCodes.RELATION_ERR;
					}
				}
			}

		
		// ステータスのセット
		if (rtn > inETMsg.getInt(TU0011ETMsg.STATUS)) {
			inETMsg.set(TU0011ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * ITU0011D004_制約ＮＯ3チェック
	 *
	 * @param inETMsg チェック対象のETMsg(TU0011ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execITU0011D004_3(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

			// チェック条件定数
			String joken4_1 = new String();
			if(!inETMsg.isNull(TU0011ETMsg.KNKN_ITNSAD_MAN_INPUT_FLG)){
				joken4_1 = inETMsg.getObject(TU0011ETMsg.KNKN_ITNSAD_MAN_INPUT_FLG).toString();
			}

			String joken4_2 = "0";

			// 制約部品引数定義
			Object joken_1_prm_1 = null;
			if(!inETMsg.isNull(TU0011ETMsg.KANYKN_ITENS_AD_CD)){
				joken_1_prm_1 = inETMsg.getObject(TU0011ETMsg.KANYKN_ITENS_AD_CD);
			}

			Object joken_1_prm_2 = null;
			if(!inETMsg.isNull(TU0011ETMsg.KANYKN_ITENS_PCD)){
				joken_1_prm_2 = inETMsg.getObject(TU0011ETMsg.KANYKN_ITENS_PCD);
			}

			// チェック条件
			if ((!inETMsg.isNull(TU0011ETMsg.KANYKN_ITENS_AD_CD) && !inETMsg.isNull(TU0011ETMsg.KANYKN_ITENS_PCD)) && joken4_1.compareTo(joken4_2) == 0) { 
			// 判定条件
			if(!(JTUejbZM0081KRCK.isAdCdExistsCheck002(inETMsg, inContext, joken_1_prm_1, joken_1_prm_2 ) == true)){
					inETMsg.set(TU0011ETMsg.KANYKN_ITENS_AD_CD_ERR, errFlag);
					if("W".equals(errFlag.substring(0,1))){
						rtn = StatusCodes.WARNING;
					} else {
						rtn = StatusCodes.RELATION_ERR;
					}
				}
			}

		
		// ステータスのセット
		if (rtn > inETMsg.getInt(TU0011ETMsg.STATUS)) {
			inETMsg.set(TU0011ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * ITU0021C002_制約ＮＯ3チェック
	 *
	 * @param inETMsg チェック対象のETMsg(TU0021ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execITU0021C002_3(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

			// チェック条件定数
			String joken2_1 = new String();
			if(!inETMsg.isNull(TU0021ETMsg.SETPLACE_AD_MAN_INPUT_FLG)){
				joken2_1 = inETMsg.getObject(TU0021ETMsg.SETPLACE_AD_MAN_INPUT_FLG).toString();
			}

			String joken2_2 = "0";

			// 制約部品引数定義
			Object joken_1_prm_1 = null;
			if(!inETMsg.isNull(TU0021ETMsg.SETPLACE_AD_CD)){
				joken_1_prm_1 = inETMsg.getObject(TU0021ETMsg.SETPLACE_AD_CD);
			}

			Object joken_1_prm_2 = null;
			if(!inETMsg.isNull(TU0021ETMsg.SETPLACE_PCD)){
				joken_1_prm_2 = inETMsg.getObject(TU0021ETMsg.SETPLACE_PCD);
			}

			// チェック条件
			if (joken2_1.compareTo(joken2_2) == 0) { 
			// 判定条件
			if(!(JTUejbZM0081KRCK.isAdCdExistsCheck001(inETMsg, inContext, joken_1_prm_1, joken_1_prm_2 ) == true)){
					inETMsg.set(TU0021ETMsg.SETPLACE_AD_CD_ERR, errFlag);
					if("W".equals(errFlag.substring(0,1))){
						rtn = StatusCodes.WARNING;
					} else {
						rtn = StatusCodes.RELATION_ERR;
					}
				}
			}

		
		// ステータスのセット
		if (rtn > inETMsg.getInt(TU0021ETMsg.STATUS)) {
			inETMsg.set(TU0021ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * ITU0021D001_制約ＮＯ3チェック
	 *
	 * @param inETMsg チェック対象のETMsg(TU0021ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execITU0021D001_3(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

			// チェック条件定数
			String joken2_1 = new String();
			if(!inETMsg.isNull(TU0021ETMsg.SETPLACE_AD_MAN_INPUT_FLG)){
				joken2_1 = inETMsg.getObject(TU0021ETMsg.SETPLACE_AD_MAN_INPUT_FLG).toString();
			}

			String joken2_2 = "0";

			// 制約部品引数定義
			Object joken_1_prm_1 = null;
			if(!inETMsg.isNull(TU0021ETMsg.SETPLACE_AD_CD)){
				joken_1_prm_1 = inETMsg.getObject(TU0021ETMsg.SETPLACE_AD_CD);
			}

			Object joken_1_prm_2 = null;
			if(!inETMsg.isNull(TU0021ETMsg.SETPLACE_PCD)){
				joken_1_prm_2 = inETMsg.getObject(TU0021ETMsg.SETPLACE_PCD);
			}

			// チェック条件
			if (joken2_1.compareTo(joken2_2) == 0) { 
			// 判定条件
			if(!(JTUejbZM0081KRCK.isAdCdExistsCheck001(inETMsg, inContext, joken_1_prm_1, joken_1_prm_2 ) == true)){
					inETMsg.set(TU0021ETMsg.SETPLACE_AD_CD_ERR, errFlag);
					if("W".equals(errFlag.substring(0,1))){
						rtn = StatusCodes.WARNING;
					} else {
						rtn = StatusCodes.RELATION_ERR;
					}
				}
			}

		
		// ステータスのセット
		if (rtn > inETMsg.getInt(TU0021ETMsg.STATUS)) {
			inETMsg.set(TU0021ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * ITU0021D002_制約ＮＯ3チェック
	 *
	 * @param inETMsg チェック対象のETMsg(TU0021ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execITU0021D002_3(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

			// チェック条件定数
			String joken2_1 = new String();
			if(!inETMsg.isNull(TU0021ETMsg.SETPLACE_AD_MAN_INPUT_FLG)){
				joken2_1 = inETMsg.getObject(TU0021ETMsg.SETPLACE_AD_MAN_INPUT_FLG).toString();
			}

			String joken2_2 = "0";

			// 制約部品引数定義
			Object joken_1_prm_1 = null;
			if(!inETMsg.isNull(TU0021ETMsg.SETPLACE_AD_CD)){
				joken_1_prm_1 = inETMsg.getObject(TU0021ETMsg.SETPLACE_AD_CD);
			}

			Object joken_1_prm_2 = null;
			if(!inETMsg.isNull(TU0021ETMsg.SETPLACE_PCD)){
				joken_1_prm_2 = inETMsg.getObject(TU0021ETMsg.SETPLACE_PCD);
			}

			// チェック条件
			if (joken2_1.compareTo(joken2_2) == 0) { 
			// 判定条件
			if(!(JTUejbZM0081KRCK.isAdCdExistsCheck001(inETMsg, inContext, joken_1_prm_1, joken_1_prm_2 ) == true)){
					inETMsg.set(TU0021ETMsg.SETPLACE_AD_CD_ERR, errFlag);
					if("W".equals(errFlag.substring(0,1))){
						rtn = StatusCodes.WARNING;
					} else {
						rtn = StatusCodes.RELATION_ERR;
					}
				}
			}

		
		// ステータスのセット
		if (rtn > inETMsg.getInt(TU0021ETMsg.STATUS)) {
			inETMsg.set(TU0021ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * ITU0091C001_制約ＮＯ3チェック
	 *
	 * @param inETMsg チェック対象のETMsg(TU0091ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execITU0091C001_3(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

			// チェック条件定数
			String joken4_1 = new String();
			if(!inETMsg.isNull(TU0091ETMsg.KEISAI_AD_MAN_INPUT_FLG)){
				joken4_1 = inETMsg.getObject(TU0091ETMsg.KEISAI_AD_MAN_INPUT_FLG).toString();
			}

			String joken4_2 = "0";

			// 制約部品引数定義
			Object joken_1_prm_1 = null;
			if(!inETMsg.isNull(TU0091ETMsg.KEISAI_AD_CD)){
				joken_1_prm_1 = inETMsg.getObject(TU0091ETMsg.KEISAI_AD_CD);
			}

			Object joken_1_prm_2 = null;
			if(!inETMsg.isNull(TU0091ETMsg.KEISAI_PCD)){
				joken_1_prm_2 = inETMsg.getObject(TU0091ETMsg.KEISAI_PCD);
			}

			// チェック条件
			if ((!inETMsg.isNull(TU0091ETMsg.KEISAI_AD_CD) && !inETMsg.isNull(TU0091ETMsg.KEISAI_PCD)) && joken4_1.compareTo(joken4_2) == 0) { 
			// 判定条件
			if(!(JTUejbZM0081KRCK.isAdCdExistsCheck001(inETMsg, inContext, joken_1_prm_1, joken_1_prm_2 ) == true)){
					inETMsg.set(TU0091ETMsg.KEISAI_AD_CD_ERR, errFlag);
					if("W".equals(errFlag.substring(0,1))){
						rtn = StatusCodes.WARNING;
					} else {
						rtn = StatusCodes.RELATION_ERR;
					}
				}
			}

		
		// ステータスのセット
		if (rtn > inETMsg.getInt(TU0091ETMsg.STATUS)) {
			inETMsg.set(TU0091ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * ITU0091C001_制約ＮＯ4チェック
	 *
	 * @param inETMsg チェック対象のETMsg(TU0091ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execITU0091C001_4(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

			// チェック条件定数
			String joken4_1 = new String();
			if(!inETMsg.isNull(TU0091ETMsg.SETPLACE_AD_MAN_INPUT_FLG)){
				joken4_1 = inETMsg.getObject(TU0091ETMsg.SETPLACE_AD_MAN_INPUT_FLG).toString();
			}

			String joken4_2 = "0";

			// 制約部品引数定義
			Object joken_1_prm_1 = null;
			if(!inETMsg.isNull(TU0091ETMsg.SETPLACE_AD_CD)){
				joken_1_prm_1 = inETMsg.getObject(TU0091ETMsg.SETPLACE_AD_CD);
			}

			Object joken_1_prm_2 = null;
			if(!inETMsg.isNull(TU0091ETMsg.SETPLACE_PCD)){
				joken_1_prm_2 = inETMsg.getObject(TU0091ETMsg.SETPLACE_PCD);
			}

			// チェック条件
			if ((!inETMsg.isNull(TU0091ETMsg.SETPLACE_AD_CD) && !inETMsg.isNull(TU0091ETMsg.SETPLACE_PCD)) && joken4_1.compareTo(joken4_2) == 0) { 
			// 判定条件
			if(!(JTUejbZM0081KRCK.isAdCdExistsCheck001(inETMsg, inContext, joken_1_prm_1, joken_1_prm_2 ) == true)){
					inETMsg.set(TU0091ETMsg.SETPLACE_AD_CD_ERR, errFlag);
					if("W".equals(errFlag.substring(0,1))){
						rtn = StatusCodes.WARNING;
					} else {
						rtn = StatusCodes.RELATION_ERR;
					}
				}
			}

		
		// ステータスのセット
		if (rtn > inETMsg.getInt(TU0091ETMsg.STATUS)) {
			inETMsg.set(TU0091ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IZM0081C001_制約ＮＯ1チェック
	 *
	 * @param inETMsg チェック対象のETMsg(ZM0081ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIZM0081C001_1(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(ZM0081ETMsg.AD_CD)){
				joken1_2 = new String(inETMsg.getObject(ZM0081ETMsg.AD_CD).toString());
			}

			String joken3_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_3 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken3_2 == null){
				joken_3 += " IS NULL ";
			}else{
				joken_3 += " = ? ";
			}


			// ＳＱＬ文の組み立て
			sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
				.append("(" + joken_1 + " AND " + joken_3 + " ) ");

			// ＳＱＬ文の解析
			pstmtQuery = con.prepareStatement(sqlQuery.toString());

			// パラメータの設定
			int para_idx = 1;
			if(joken1_2 != null){
				CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
			}
			if(joken3_2 != null){
				CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken3_2);
			}

			// ＳＱＬ文の実行
			rsltQuery = pstmtQuery.executeQuery();

			if(rsltQuery.next()){
				// 判定条件
				if(!(rsltQuery.getLong("CNT")>0)){
					inETMsg.set(ZM0081ETMsg.AD_CD_ERR, errFlag);
					if("W".equals(errFlag.substring(0,1))){
						rtn = StatusCodes.WARNING;
					} else {
						rtn = StatusCodes.RELATION_ERR;
					}
				}
			}

		} catch(SQLException e) {
			inETMsg.set(ZM0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(ZM0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(ZM0081ETMsg.STATUS)) {
			inETMsg.set(ZM0081ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IZM0081C001_制約ＮＯ2チェック
	 *
	 * @param inETMsg チェック対象のETMsg(ZM0081ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIZM0081C001_2(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

			// 制約部品引数定義
			Object joken_1_prm_1 = "ZM0081";

			// 判定条件
			if(!(JPCModelCommon.succeededExclusiveLockForGene(inETMsg, inContext, joken_1_prm_1 ) == true)){
				inETMsg.set(ZM0081ETMsg.AD_CD_ERR, errFlag);
				if("W".equals(errFlag.substring(0,1))){
					rtn = StatusCodes.WARNING;
				} else {
					rtn = StatusCodes.RELATION_ERR;
				}
			}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(ZM0081ETMsg.STATUS)) {
			inETMsg.set(ZM0081ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IZM0081D001_制約ＮＯ1チェック
	 *
	 * @param inETMsg チェック対象のETMsg(ZM0081ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIZM0081D001_1(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(ZM0081ETMsg.AD_CD)){
				joken1_2 = new String(inETMsg.getObject(ZM0081ETMsg.AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}


			// ＳＱＬ文の組み立て
			sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
				.append("(" + joken_1 + " AND " + joken_2 + " ) ");

			// ＳＱＬ文の解析
			pstmtQuery = con.prepareStatement(sqlQuery.toString());

			// パラメータの設定
			int para_idx = 1;
			if(joken1_2 != null){
				CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
			}
			if(joken2_2 != null){
				CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
			}

			// ＳＱＬ文の実行
			rsltQuery = pstmtQuery.executeQuery();

			if(rsltQuery.next()){
				// 判定条件
				if(!(rsltQuery.getLong("CNT")>0)){
					inETMsg.set(ZM0081ETMsg.AD_CD_ERR, errFlag);
					if("W".equals(errFlag.substring(0,1))){
						rtn = StatusCodes.WARNING;
					} else {
						rtn = StatusCodes.RELATION_ERR;
					}
				}
			}

		} catch(SQLException e) {
			inETMsg.set(ZM0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(ZM0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(ZM0081ETMsg.STATUS)) {
			inETMsg.set(ZM0081ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IZM0081D001_制約ＮＯ2チェック
	 *
	 * @param inETMsg チェック対象のETMsg(ZM0081ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIZM0081D001_2(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(ZM0081ETMsg.AD_CD)){
				joken1_2 = new String(inETMsg.getObject(ZM0081ETMsg.AD_CD).toString());
			}

			String joken2_2 = null;
			if(!inETMsg.isNull(ZM0081ETMsg.GENE_ADD_DTM)){
				joken2_2 = new String(inETMsg.getObject(ZM0081ETMsg.GENE_ADD_DTM).toString());
			}

			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.GENE_ADD_DTM);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}


			// ＳＱＬ文の組み立て
			sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
				.append("(" + joken_1 + " AND " + joken_2 + " ) ");

			// ＳＱＬ文の解析
			pstmtQuery = con.prepareStatement(sqlQuery.toString());

			// パラメータの設定
			int para_idx = 1;
			if(joken1_2 != null){
				CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
			}
			if(joken2_2 != null){
				CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
			}

			// ＳＱＬ文の実行
			rsltQuery = pstmtQuery.executeQuery();

			if(rsltQuery.next()){
				// 判定条件
				if(rsltQuery.getLong("CNT")>0){
					inETMsg.set(ZM0081ETMsg.AD_CD_ERR, errFlag);
					if("W".equals(errFlag.substring(0,1))){
						rtn = StatusCodes.WARNING;
					} else {
						rtn = StatusCodes.RELATION_ERR;
					}
				}
			}

		} catch(SQLException e) {
			inETMsg.set(ZM0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(ZM0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(ZM0081ETMsg.STATUS)) {
			inETMsg.set(ZM0081ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IZM0081D001_制約ＮＯ7チェック
	 *
	 * @param inETMsg チェック対象のETMsg(ZM0081ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIZM0081D001_7(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(ZM0081ETMsg.NEW_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(ZM0081ETMsg.NEW_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}


			// ＳＱＬ文の組み立て
			sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
				.append("(" + joken_1 + " AND " + joken_2 + " ) ");

			// ＳＱＬ文の解析
			pstmtQuery = con.prepareStatement(sqlQuery.toString());

			// パラメータの設定
			int para_idx = 1;
			if(joken1_2 != null){
				CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
			}
			if(joken2_2 != null){
				CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
			}

			// ＳＱＬ文の実行
			rsltQuery = pstmtQuery.executeQuery();

			if(rsltQuery.next()){
				// 判定条件
				if(!(rsltQuery.getLong("CNT")>0)){
					inETMsg.set(ZM0081ETMsg.NEW_AD_CD_ERR, errFlag);
					if("W".equals(errFlag.substring(0,1))){
						rtn = StatusCodes.WARNING;
					} else {
						rtn = StatusCodes.RELATION_ERR;
					}
				}
			}

		} catch(SQLException e) {
			inETMsg.set(ZM0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(ZM0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(ZM0081ETMsg.STATUS)) {
			inETMsg.set(ZM0081ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IZM0081D001_制約ＮＯ8チェック
	 *
	 * @param inETMsg チェック対象のETMsg(ZM0081ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIZM0081D001_8(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

			// 制約部品引数定義
			Object joken_1_prm_1 = "ZM0081";

			// 判定条件
			if(!(JPCModelCommon.succeededExclusiveLockForGene(inETMsg, inContext, joken_1_prm_1 ) == true)){
				inETMsg.set(ZM0081ETMsg.AD_CD_ERR, errFlag);
				if("W".equals(errFlag.substring(0,1))){
					rtn = StatusCodes.WARNING;
				} else {
					rtn = StatusCodes.RELATION_ERR;
				}
			}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(ZM0081ETMsg.STATUS)) {
			inETMsg.set(ZM0081ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IZM0081D003_制約ＮＯ1チェック
	 *
	 * @param inETMsg チェック対象のETMsg(ZM0081ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIZM0081D003_1(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(ZM0081ETMsg.AD_CD)){
				joken1_2 = new String(inETMsg.getObject(ZM0081ETMsg.AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}


			// ＳＱＬ文の組み立て
			sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
				.append("(" + joken_1 + " AND " + joken_2 + " ) ");

			// ＳＱＬ文の解析
			pstmtQuery = con.prepareStatement(sqlQuery.toString());

			// パラメータの設定
			int para_idx = 1;
			if(joken1_2 != null){
				CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
			}
			if(joken2_2 != null){
				CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
			}

			// ＳＱＬ文の実行
			rsltQuery = pstmtQuery.executeQuery();

			if(rsltQuery.next()){
				// 判定条件
				if(rsltQuery.getLong("CNT")>0){
					inETMsg.set(ZM0081ETMsg.AD_CD_ERR, errFlag);
					if("W".equals(errFlag.substring(0,1))){
						rtn = StatusCodes.WARNING;
					} else {
						rtn = StatusCodes.RELATION_ERR;
					}
				}
			}

		} catch(SQLException e) {
			inETMsg.set(ZM0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(ZM0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(ZM0081ETMsg.STATUS)) {
			inETMsg.set(ZM0081ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IZM0081D003_制約ＮＯ2チェック
	 *
	 * @param inETMsg チェック対象のETMsg(ZM0081ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIZM0081D003_2(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(ZM0081ETMsg.AD_CD)){
				joken1_2 = new String(inETMsg.getObject(ZM0081ETMsg.AD_CD).toString());
			}

			String joken2_2 = null;
			if(!inETMsg.isNull(ZM0081ETMsg.GENE_ADD_DTM)){
				joken2_2 = new String(inETMsg.getObject(ZM0081ETMsg.GENE_ADD_DTM).toString());
			}

			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.GENE_ADD_DTM);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}


			// ＳＱＬ文の組み立て
			sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
				.append("(" + joken_1 + " AND " + joken_2 + " ) ");

			// ＳＱＬ文の解析
			pstmtQuery = con.prepareStatement(sqlQuery.toString());

			// パラメータの設定
			int para_idx = 1;
			if(joken1_2 != null){
				CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
			}
			if(joken2_2 != null){
				CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
			}

			// ＳＱＬ文の実行
			rsltQuery = pstmtQuery.executeQuery();

			if(rsltQuery.next()){
				// 判定条件
				if(rsltQuery.getLong("CNT")>0){
					inETMsg.set(ZM0081ETMsg.AD_CD_ERR, errFlag);
					if("W".equals(errFlag.substring(0,1))){
						rtn = StatusCodes.WARNING;
					} else {
						rtn = StatusCodes.RELATION_ERR;
					}
				}
			}

		} catch(SQLException e) {
			inETMsg.set(ZM0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(ZM0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(ZM0081ETMsg.STATUS)) {
			inETMsg.set(ZM0081ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IZM0081D004_制約ＮＯ1チェック
	 *
	 * @param inETMsg チェック対象のETMsg(ZM0081ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIZM0081D004_1(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(ZM0081ETMsg.AD_CD)){
				joken1_2 = new String(inETMsg.getObject(ZM0081ETMsg.AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}


			// ＳＱＬ文の組み立て
			sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
				.append("(" + joken_1 + " AND " + joken_2 + " ) ");

			// ＳＱＬ文の解析
			pstmtQuery = con.prepareStatement(sqlQuery.toString());

			// パラメータの設定
			int para_idx = 1;
			if(joken1_2 != null){
				CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
			}
			if(joken2_2 != null){
				CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
			}

			// ＳＱＬ文の実行
			rsltQuery = pstmtQuery.executeQuery();

			if(rsltQuery.next()){
				// 判定条件
				if(!(rsltQuery.getLong("CNT")>0)){
					inETMsg.set(ZM0081ETMsg.AD_CD_ERR, errFlag);
					if("W".equals(errFlag.substring(0,1))){
						rtn = StatusCodes.WARNING;
					} else {
						rtn = StatusCodes.RELATION_ERR;
					}
				}
			}

		} catch(SQLException e) {
			inETMsg.set(ZM0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(ZM0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(ZM0081ETMsg.STATUS)) {
			inETMsg.set(ZM0081ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IZM0081D004_制約ＮＯ2チェック
	 *
	 * @param inETMsg チェック対象のETMsg(ZM0081ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIZM0081D004_2(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(ZM0081ETMsg.AD_CD)){
				joken1_2 = new String(inETMsg.getObject(ZM0081ETMsg.AD_CD).toString());
			}

			String joken2_2 = null;
			if(!inETMsg.isNull(ZM0081ETMsg.GENE_ADD_DTM)){
				joken2_2 = new String(inETMsg.getObject(ZM0081ETMsg.GENE_ADD_DTM).toString());
			}

			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.GENE_ADD_DTM);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}


			// ＳＱＬ文の組み立て
			sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
				.append("(" + joken_1 + " AND " + joken_2 + " ) ");

			// ＳＱＬ文の解析
			pstmtQuery = con.prepareStatement(sqlQuery.toString());

			// パラメータの設定
			int para_idx = 1;
			if(joken1_2 != null){
				CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
			}
			if(joken2_2 != null){
				CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
			}

			// ＳＱＬ文の実行
			rsltQuery = pstmtQuery.executeQuery();

			if(rsltQuery.next()){
				// 判定条件
				if(rsltQuery.getLong("CNT")>0){
					inETMsg.set(ZM0081ETMsg.AD_CD_ERR, errFlag);
					if("W".equals(errFlag.substring(0,1))){
						rtn = StatusCodes.WARNING;
					} else {
						rtn = StatusCodes.RELATION_ERR;
					}
				}
			}

		} catch(SQLException e) {
			inETMsg.set(ZM0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(ZM0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(ZM0081ETMsg.STATUS)) {
			inETMsg.set(ZM0081ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IZM0081D004_制約ＮＯ7チェック
	 *
	 * @param inETMsg チェック対象のETMsg(ZM0081ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIZM0081D004_7(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(ZM0081ETMsg.NEW_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(ZM0081ETMsg.NEW_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}


			// ＳＱＬ文の組み立て
			sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
				.append("(" + joken_1 + " AND " + joken_2 + " ) ");

			// ＳＱＬ文の解析
			pstmtQuery = con.prepareStatement(sqlQuery.toString());

			// パラメータの設定
			int para_idx = 1;
			if(joken1_2 != null){
				CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
			}
			if(joken2_2 != null){
				CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
			}

			// ＳＱＬ文の実行
			rsltQuery = pstmtQuery.executeQuery();

			if(rsltQuery.next()){
				// 判定条件
				if(!(rsltQuery.getLong("CNT")>0)){
					inETMsg.set(ZM0081ETMsg.NEW_AD_CD_ERR, errFlag);
					if("W".equals(errFlag.substring(0,1))){
						rtn = StatusCodes.WARNING;
					} else {
						rtn = StatusCodes.RELATION_ERR;
					}
				}
			}

		} catch(SQLException e) {
			inETMsg.set(ZM0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(ZM0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(ZM0081ETMsg.STATUS)) {
			inETMsg.set(ZM0081ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IZM0081D004_制約ＮＯ8チェック
	 *
	 * @param inETMsg チェック対象のETMsg(ZM0081ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIZM0081D004_8(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

			// 制約部品引数定義
			Object joken_1_prm_1 = "ZM0081";

			// 判定条件
			if(!(JPCModelCommon.succeededExclusiveLockForGene(inETMsg, inContext, joken_1_prm_1 ) == true)){
				inETMsg.set(ZM0081ETMsg.AD_CD_ERR, errFlag);
				if("W".equals(errFlag.substring(0,1))){
					rtn = StatusCodes.WARNING;
				} else {
					rtn = StatusCodes.RELATION_ERR;
				}
			}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(ZM0081ETMsg.STATUS)) {
			inETMsg.set(ZM0081ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IZM0081D005_制約ＮＯ1チェック
	 *
	 * @param inETMsg チェック対象のETMsg(ZM0081ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIZM0081D005_1(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(ZM0081ETMsg.AD_CD)){
				joken1_2 = new String(inETMsg.getObject(ZM0081ETMsg.AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}


			// ＳＱＬ文の組み立て
			sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
				.append("(" + joken_1 + " AND " + joken_2 + " ) ");

			// ＳＱＬ文の解析
			pstmtQuery = con.prepareStatement(sqlQuery.toString());

			// パラメータの設定
			int para_idx = 1;
			if(joken1_2 != null){
				CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
			}
			if(joken2_2 != null){
				CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
			}

			// ＳＱＬ文の実行
			rsltQuery = pstmtQuery.executeQuery();

			if(rsltQuery.next()){
				// 判定条件
				if(!(rsltQuery.getLong("CNT")>0)){
					inETMsg.set(ZM0081ETMsg.AD_CD_ERR, errFlag);
					if("W".equals(errFlag.substring(0,1))){
						rtn = StatusCodes.WARNING;
					} else {
						rtn = StatusCodes.RELATION_ERR;
					}
				}
			}

		} catch(SQLException e) {
			inETMsg.set(ZM0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(ZM0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(ZM0081ETMsg.STATUS)) {
			inETMsg.set(ZM0081ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IZM0081D005_制約ＮＯ2チェック
	 *
	 * @param inETMsg チェック対象のETMsg(ZM0081ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIZM0081D005_2(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(ZM0081ETMsg.AD_CD)){
				joken1_2 = new String(inETMsg.getObject(ZM0081ETMsg.AD_CD).toString());
			}

			String joken2_2 = null;
			if(!inETMsg.isNull(ZM0081ETMsg.GENE_ADD_DTM)){
				joken2_2 = new String(inETMsg.getObject(ZM0081ETMsg.GENE_ADD_DTM).toString());
			}

			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.GENE_ADD_DTM);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}


			// ＳＱＬ文の組み立て
			sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
				.append("(" + joken_1 + " AND " + joken_2 + " ) ");

			// ＳＱＬ文の解析
			pstmtQuery = con.prepareStatement(sqlQuery.toString());

			// パラメータの設定
			int para_idx = 1;
			if(joken1_2 != null){
				CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
			}
			if(joken2_2 != null){
				CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
			}

			// ＳＱＬ文の実行
			rsltQuery = pstmtQuery.executeQuery();

			if(rsltQuery.next()){
				// 判定条件
				if(rsltQuery.getLong("CNT")>0){
					inETMsg.set(ZM0081ETMsg.AD_CD_ERR, errFlag);
					if("W".equals(errFlag.substring(0,1))){
						rtn = StatusCodes.WARNING;
					} else {
						rtn = StatusCodes.RELATION_ERR;
					}
				}
			}

		} catch(SQLException e) {
			inETMsg.set(ZM0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(ZM0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(ZM0081ETMsg.STATUS)) {
			inETMsg.set(ZM0081ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IZM0081D005_制約ＮＯ7チェック
	 *
	 * @param inETMsg チェック対象のETMsg(ZM0081ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIZM0081D005_7(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(ZM0081ETMsg.NEW_AD_CD)){
				joken1_2 = new String(inETMsg.getObject(ZM0081ETMsg.NEW_AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}


			// ＳＱＬ文の組み立て
			sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
				.append("(" + joken_1 + " AND " + joken_2 + " ) ");

			// ＳＱＬ文の解析
			pstmtQuery = con.prepareStatement(sqlQuery.toString());

			// パラメータの設定
			int para_idx = 1;
			if(joken1_2 != null){
				CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
			}
			if(joken2_2 != null){
				CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
			}

			// ＳＱＬ文の実行
			rsltQuery = pstmtQuery.executeQuery();

			if(rsltQuery.next()){
				// 判定条件
				if(!(rsltQuery.getLong("CNT")>0)){
					inETMsg.set(ZM0081ETMsg.NEW_AD_CD_ERR, errFlag);
					if("W".equals(errFlag.substring(0,1))){
						rtn = StatusCodes.WARNING;
					} else {
						rtn = StatusCodes.RELATION_ERR;
					}
				}
			}

		} catch(SQLException e) {
			inETMsg.set(ZM0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(ZM0081ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(ZM0081ETMsg.STATUS)) {
			inETMsg.set(ZM0081ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IZM0081D005_制約ＮＯ8チェック
	 *
	 * @param inETMsg チェック対象のETMsg(ZM0081ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIZM0081D005_8(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

			// 制約部品引数定義
			Object joken_1_prm_1 = "ZM0081";

			// 判定条件
			if(!(JPCModelCommon.succeededExclusiveLockForGene(inETMsg, inContext, joken_1_prm_1 ) == true)){
				inETMsg.set(ZM0081ETMsg.AD_CD_ERR, errFlag);
				if("W".equals(errFlag.substring(0,1))){
					rtn = StatusCodes.WARNING;
				} else {
					rtn = StatusCodes.RELATION_ERR;
				}
			}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(ZM0081ETMsg.STATUS)) {
			inETMsg.set(ZM0081ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IZM0091D002_制約ＮＯ3チェック
	 *
	 * @param inETMsg チェック対象のETMsg(ZM0091ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIZM0091D002_3(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(ZM0091ETMsg.AD_CD)){
				joken1_2 = new String(inETMsg.getObject(ZM0091ETMsg.AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}


			// ＳＱＬ文の組み立て
			sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
				.append("(" + joken_1 + " AND " + joken_2 + " ) ");

			// ＳＱＬ文の解析
			pstmtQuery = con.prepareStatement(sqlQuery.toString());

			// パラメータの設定
			int para_idx = 1;
			if(joken1_2 != null){
				CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
			}
			if(joken2_2 != null){
				CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
			}

			// ＳＱＬ文の実行
			rsltQuery = pstmtQuery.executeQuery();

			if(rsltQuery.next()){
				// 判定条件
				if(!(rsltQuery.getLong("CNT")>0)){
					inETMsg.set(ZM0091ETMsg.AD_CD_ERR, errFlag);
					if("W".equals(errFlag.substring(0,1))){
						rtn = StatusCodes.WARNING;
					} else {
						rtn = StatusCodes.RELATION_ERR;
					}
				}
			}

		} catch(SQLException e) {
			inETMsg.set(ZM0091ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(ZM0091ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(ZM0091ETMsg.STATUS)) {
			inETMsg.set(ZM0091ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IZM0091D003_制約ＮＯ3チェック
	 *
	 * @param inETMsg チェック対象のETMsg(ZM0091ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIZM0091D003_3(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(ZM0091ETMsg.AD_CD)){
				joken1_2 = new String(inETMsg.getObject(ZM0091ETMsg.AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}


			// ＳＱＬ文の組み立て
			sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
				.append("(" + joken_1 + " AND " + joken_2 + " ) ");

			// ＳＱＬ文の解析
			pstmtQuery = con.prepareStatement(sqlQuery.toString());

			// パラメータの設定
			int para_idx = 1;
			if(joken1_2 != null){
				CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
			}
			if(joken2_2 != null){
				CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
			}

			// ＳＱＬ文の実行
			rsltQuery = pstmtQuery.executeQuery();

			if(rsltQuery.next()){
				// 判定条件
				if(!(rsltQuery.getLong("CNT")>0)){
					inETMsg.set(ZM0091ETMsg.AD_CD_ERR, errFlag);
					if("W".equals(errFlag.substring(0,1))){
						rtn = StatusCodes.WARNING;
					} else {
						rtn = StatusCodes.RELATION_ERR;
					}
				}
			}

		} catch(SQLException e) {
			inETMsg.set(ZM0091ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(ZM0091ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(ZM0091ETMsg.STATUS)) {
			inETMsg.set(ZM0091ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IZM0091D004_制約ＮＯ3チェック
	 *
	 * @param inETMsg チェック対象のETMsg(ZM0091ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIZM0091D004_3(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(ZM0091ETMsg.AD_CD)){
				joken1_2 = new String(inETMsg.getObject(ZM0091ETMsg.AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}


			// ＳＱＬ文の組み立て
			sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
				.append("(" + joken_1 + " AND " + joken_2 + " ) ");

			// ＳＱＬ文の解析
			pstmtQuery = con.prepareStatement(sqlQuery.toString());

			// パラメータの設定
			int para_idx = 1;
			if(joken1_2 != null){
				CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
			}
			if(joken2_2 != null){
				CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
			}

			// ＳＱＬ文の実行
			rsltQuery = pstmtQuery.executeQuery();

			if(rsltQuery.next()){
				// 判定条件
				if(!(rsltQuery.getLong("CNT")>0)){
					inETMsg.set(ZM0091ETMsg.AD_CD_ERR, errFlag);
					if("W".equals(errFlag.substring(0,1))){
						rtn = StatusCodes.WARNING;
					} else {
						rtn = StatusCodes.RELATION_ERR;
					}
				}
			}

		} catch(SQLException e) {
			inETMsg.set(ZM0091ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(ZM0091ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(ZM0091ETMsg.STATUS)) {
			inETMsg.set(ZM0091ETMsg.STATUS, rtn);
		}

		return rtn;

	}

	/**
	 * IZM0091D005_制約ＮＯ3チェック
	 *
	 * @param inETMsg チェック対象のETMsg(ZM0091ETMsg)
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param errFlag ERRフラグ
	 * @return int チェック結果
	 */
	private int execIZM0091D005_3(CAANMsg inETMsg, AgentDispatchContext inContext, String errFlag){

		// ステータス
		int rtn = 0;

		Connection con = JSYejbConnection.getConnection(ZM0081ETMsg.getTableName());

		PreparedStatement pstmtQuery = null;
		ResultSet rsltQuery = null;
		StringBuffer sqlQuery = new StringBuffer();

		try{

			// ＳＱＬ引数定義
			String joken1_2 = null;
			if(!inETMsg.isNull(ZM0091ETMsg.AD_CD)){
				joken1_2 = new String(inETMsg.getObject(ZM0091ETMsg.AD_CD).toString());
			}

			String joken2_2 = "0";
			// 条件文定義
			String joken_1 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.AD_CD);
			if(joken1_2 == null){
				joken_1 += " IS NULL ";
			}else{
				joken_1 += " = ? ";
			}

			String joken_2 = ZM0081ETMsg.getDBColumnName(ZM0081ETMsg.MK_FLG);
			if(joken2_2 == null){
				joken_2 += " IS NULL ";
			}else{
				joken_2 += " = ? ";
			}


			// ＳＱＬ文の組み立て
			sqlQuery.append("SELECT COUNT(*) CNT FROM ").append(ZM0081ETMsg.getTableName()).append(" WHERE ")
				.append("(" + joken_1 + " AND " + joken_2 + " ) ");

			// ＳＱＬ文の解析
			pstmtQuery = con.prepareStatement(sqlQuery.toString());

			// パラメータの設定
			int para_idx = 1;
			if(joken1_2 != null){
				CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken1_2);
			}
			if(joken2_2 != null){
				CAANJDBCUtil.setParam(pstmtQuery, para_idx++ , joken2_2);
			}

			// ＳＱＬ文の実行
			rsltQuery = pstmtQuery.executeQuery();

			if(rsltQuery.next()){
				// 判定条件
				if(!(rsltQuery.getLong("CNT")>0)){
					inETMsg.set(ZM0091ETMsg.AD_CD_ERR, errFlag);
					if("W".equals(errFlag.substring(0,1))){
						rtn = StatusCodes.WARNING;
					} else {
						rtn = StatusCodes.RELATION_ERR;
					}
				}
			}

		} catch(SQLException e) {
			inETMsg.set(ZM0091ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
			throw new CAANRuntimeException(e);
		} finally {
			// このメソッドで確保した資源の解放
			try {
				if(rsltQuery != null) {
					rsltQuery.close();
				}
				if(pstmtQuery != null) {
					pstmtQuery.close();
				}
				if(con != null) {
					CAANConnectionMgr.getInstance().close(con);
				}
			} catch(SQLException e) {
				inETMsg.set(ZM0091ETMsg.STATUS, StatusCodes.FIND_DB_ERR);
				throw new CAANRuntimeException(e);
			}
		}
		
		// ステータスのセット
		if (rtn > inETMsg.getInt(ZM0091ETMsg.STATUS)) {
			inETMsg.set(ZM0091ETMsg.STATUS, rtn);
		}

		return rtn;

	}

}

