/*********************************************************************
*	All Rights reserved,Copyright (c) K-Opticom
**********************************************************************
*＜プログラム内容＞
*   システム名      ：eo顧客基幹システム構築
*   モジュール名    ：JCKejbCK0051DBABase
*   ソースファイル名：JCKejbCK0051DBABase.java
*   作成者          ：富士通
*   日付            ：2011年03月17日
*＜機能概要＞
*   問合せ客の制約部品クラス
*＜修正履歴＞
*   バージョン  修正日      修正者      修正内容
*   v1.00.00    2011/03/17  富士通      新規作成
*
**********************************************************************/

package eo.ejb.common.db;

import com.fujitsu.futurity.model.base.CAANMsg;
import com.fujitsu.futurity.model.ejb.common.fw.AgentDispatchContext;

import eo.ejb.cbm.entity.CK0051ETMsg;
import eo.ejb.cbm.entity.CK0051LE;

/**
 * <p>
 * 問合せ客の制約部品クラスです。
 * </p>
 * @author 富士通
 */
public class JCKejbCK0051DBABase
{

	/**
	 * <p>
	 * 新しいJSYejbCK0051DBABaseを作成します。
	 * </p>
	 */
	public JCKejbCK0051DBABase()
	{
	}

	/**
	 * <p>
	 * 世代を管理するカラム名を取得します。
	 * </p>
	 * @return 世代を管理するカラム名
	 */
	protected String getGenerationColumn()
	{
		return null;
	}

	/**
	 * <p>
	 * 無効状態を管理するカラム名を取得します。
	 * </p>
	 * @return 無効状態を管理するカラム名
	 */
	protected String getInvalidColumn()
	{
		return CK0051ETMsg.MK_FLG;
	}

	/**
	 * <p>
	 * 予約管理エンティティか判定します。
	 * </p>
	 * @return 予約管理エンティティの場合はtrue
	 */
	protected boolean isReserveMgr()
	{
		return false;
	}

	/**
	 * <p>
	 * 予約適用基準日となるカラム名を取得します。
	 * </p>
	 * @return 予約適用基準日となるカラム名
	 */
	protected String getCurrentColumn()
	{
		return null;
	}

	/**
	 * <p>
	 * 予約の状態を管理するエンティティか判定します。
	 * </p>
	 * @return 予約の状態を管理するエンティティの場合はtrue
	 */
	protected boolean isReserveStateMgr()
	{
		return false;
	}

	/**
	 * <p>
	 * 予約の状態を管理するカラム名を取得します。
	 * </p>
	 * @return 予約の状態を管理するカラム名
	 */
	protected String getReserveStateColumn()
	{
		return null;
	}

	/**
	 * <p>
	 * プライマリキーによる存在チェックを行います。
	 * </p>
	 * @param inMsg 処理対象のメッセージキャリア
	 * @param inContext Agentから渡されたAgentDispatchContext
	 * @param proscst_no 問合せ客番号
	 * @return データが存在する場合はtrue、存在しない場合はfalse
	 */
	public boolean isExistsPrimaryKey(CAANMsg inMsg, AgentDispatchContext inContext, String proscst_no)
	{
		// 検索条件の設定
		CAANMsg msg = new CAANMsg(CK0051ETMsg.class.getName());
		msg.set(CK0051ETMsg.PROSCST_NO, proscst_no);

		// LogicalEntity呼び出し
		CK0051LE le = new CK0051LE();

		// 検索処理の実行
		CAANMsg ret = le.findByPrimaryKey(msg);

		// 検索結果の判定
		if (ret == null)
		{
			return false;
		}

		return true;
	}

}
