/*******************************************************************************
*	All Rights reserved,Copyright (c) K-Opticom
********************************************************************************
*＜プログラム内容＞
*	システム名		：eo顧客基幹システム
*   モジュール名    ：JCCejbCC0041DBABase
*   ソースファイル名：JCCejbCC0041DBABase.java
*   作成者          ：富士通
*   日付            ：2011年05月26日
*＜機能概要＞
*   メールマスタの制約部品クラス
*＜修正履歴＞
*   バージョン  修正日      修正者      修正内容
*   v1.00.00    2011/05/26  富士通      新規作成
*
**********************************************************************/

package eo.ejb.common.db;

import com.fujitsu.futurity.model.base.CAANMsg;
import eo.ejb.cbm.entity.CC0041ETMsg;
import eo.ejb.cbm.cbmmsg.CC0041CBMMsg;
/**
 * <p>
 * メールマスタの情報取得部品クラスです。
 * </p>
 * @author 富士通
 */
public class JCCejbCC0041DBABase extends JPCejbDBABase
{

	/**
	 * <p>
	 * 新しいJSYejbCC0041DBABaseを作成します。
	 * </p>
	 */
	public JCCejbCC0041DBABase()
	{
		super(CC0041ETMsg.class.getName());
	}

	/**
	 * <p>
	 * 世代を管理するカラム名を取得します。
	 * </p>
	 * @return 世代を管理するカラム名
	 */
	protected String getGenerationColumn()
	{
		return CC0041ETMsg.GENE_ADD_DTM;
	}

	/**
	 * <p>
	 * 無効状態を管理するカラム名を取得します。
	 * </p>
	 * @return 無効状態を管理するカラム名
	 */
	protected String getInvalidColumn()
	{
		return CC0041ETMsg.MK_FLG;
	}

	/**
	 * <p>
	 * 予約管理エンティティか判定します。
	 * </p>
	 * @return 予約管理エンティティの場合はtrue
	 */
	protected boolean isReserveMgr()
	{
		return false;
	}

	/**
	 * <p>
	 * 予約適用基準日となるカラム名を取得します。
	 * </p>
	 * @return 予約適用基準日となるカラム名
	 */
	protected String getCurrentColumn()
	{
		return null;
	}

	/**
	 * <p>
	 * 予約の状態を管理するカラム名を取得します。
	 * </p>
	 * @return 予約の状態を管理するカラム名
	 */
	protected String getReserveStateColumn()
	{
		return null;
	}
	
	/**
	 * <p>
	 * 予約の状態を管理するエンティティか判定します。
	 * </p>
	 * @return 予約の状態を管理するエンティティの場合はtrue
	 */
	protected boolean isReserveStateMgr()
	{
		return false;
	}
	
	/**
	 * <p>
	 * 指定の電子ファイル管理番号の存在レコードを取得します
	 * </p>
	 * @param eFileNo 電子ファイル管理番号
	 * @return CAANMsg データを格納したレコード
	 * @exception Exception
	 */
	public CAANMsg getPrimaryRecord(String eFileNo) throws Exception
	{
		// 検索条件の設定
		CAANMsg inMsg = new CAANMsg(CC0041CBMMsg.class.getName());
		inMsg.set(CC0041ETMsg.EFILE_KANRI_NO, eFileNo);
		
		// 検索処理の実行
		CAANMsg outMsg = super.findByCurrent(inMsg);
		
		return outMsg;
	}
	
	/**
	 * <p>
	 * 指定の電子ファイル管理番号のレコードの存在有無を確認します
	 * </p>
	 * @param eFileNo 電子ファイル管理番号
	 * @return boolean 存在有無
	 * @exception Exception
	 */
	public boolean isExistRecord(String eFileNo) throws Exception
	{
		// 検索条件の設定
		CAANMsg inMsg = new CAANMsg(CC0041CBMMsg.class.getName());
		inMsg.set(CC0041ETMsg.EFILE_KANRI_NO, eFileNo);
		
		// 検索処理の実行
		CAANMsg outMsg = super.findByCurrent(inMsg);
		if(outMsg == null)
		{
			return false;
		}
		return true;
	}
}
