// =============================================================================== // Load Referrer Internal Helper // ============================= /** * Help load referrer internally. * About internal policy, the value of primary key(and others too) is treated as CaseInsensitive. * @param <LOCAL_ENTITY> The type of base entity. * @param <PK> The type of primary key. * @param <REFERRER_CB> The type of referrer condition-bean. * @param <REFERRER_ENTITY> The type of referrer entity. * @param localEntityList The list of local entity. (NotNull) * @param loadReferrerOption The option of loadReferrer. (NotNull) * @param callback The internal call-back of loadReferrer. (NotNull) */ protected virtual void HelpLoadReferrerInternally <LOCAL_ENTITY, PK, REFERRER_CB, REFERRER_ENTITY>( IList <LOCAL_ENTITY> localEntityList , LoadReferrerOption <REFERRER_CB, REFERRER_ENTITY> loadReferrerOption , InternalLoadReferrerCallback <LOCAL_ENTITY, PK, REFERRER_CB, REFERRER_ENTITY> callback) where LOCAL_ENTITY : Entity where REFERRER_CB : ConditionBean where REFERRER_ENTITY : Entity { DoHelpLoadReferrerInternally(localEntityList, loadReferrerOption, callback); }
public virtual void LoadDch客室利用台帳List(IList <Mst客室マスタ> mst客室マスタList, LoadReferrerOption <Dch客室利用台帳CB, Dch客室利用台帳> loadReferrerOption) { AssertObjectNotNull("mst客室マスタList", mst客室マスタList); AssertObjectNotNull("loadReferrerOption", loadReferrerOption); if (mst客室マスタList.Count == 0) { return; } Dch客室利用台帳Bhv referrerBhv = xgetBSFLR().Select <Dch客室利用台帳Bhv>(); HelpLoadReferrerInternally <Mst客室マスタ, String, Dch客室利用台帳CB, Dch客室利用台帳> (mst客室マスタList, loadReferrerOption, new MyInternalLoadDch客室利用台帳ListCallback(referrerBhv)); }
public virtual void LoadMst画面マスタList(IList <Kbnメニュー区分> kbnメニュー区分List, LoadReferrerOption <Mst画面マスタCB, Mst画面マスタ> loadReferrerOption) { AssertObjectNotNull("kbnメニュー区分List", kbnメニュー区分List); AssertObjectNotNull("loadReferrerOption", loadReferrerOption); if (kbnメニュー区分List.Count == 0) { return; } Mst画面マスタBhv referrerBhv = xgetBSFLR().Select <Mst画面マスタBhv>(); HelpLoadReferrerInternally <Kbnメニュー区分, String, Mst画面マスタCB, Mst画面マスタ> (kbnメニュー区分List, loadReferrerOption, new MyInternalLoadMst画面マスタListCallback(referrerBhv)); }
public virtual void LoadDch従業員職位履歴台帳List(IList <Kbn職位区分> kbn職位区分List, LoadReferrerOption <Dch従業員職位履歴台帳CB, Dch従業員職位履歴台帳> loadReferrerOption) { AssertObjectNotNull("kbn職位区分List", kbn職位区分List); AssertObjectNotNull("loadReferrerOption", loadReferrerOption); if (kbn職位区分List.Count == 0) { return; } Dch従業員職位履歴台帳Bhv referrerBhv = xgetBSFLR().Select <Dch従業員職位履歴台帳Bhv>(); HelpLoadReferrerInternally <Kbn職位区分, String, Dch従業員職位履歴台帳CB, Dch従業員職位履歴台帳> (kbn職位区分List, loadReferrerOption, new MyInternalLoadDch従業員職位履歴台帳ListCallback(referrerBhv)); }
public virtual void LoadDch客室利用台帳List(Mst客室マスタ mst客室マスタ, LoadReferrerOption <Dch客室利用台帳CB, Dch客室利用台帳> loadReferrerOption) { AssertObjectNotNull("mst客室マスタ", mst客室マスタ); AssertObjectNotNull("loadReferrerOption", loadReferrerOption); LoadDch客室利用台帳List(xnewLRLs <Mst客室マスタ>(mst客室マスタ), loadReferrerOption); }
/** * Help load referrer internally. * About internal policy, the value of primary key(and others too) is treated as CaseInsensitive. * @param <LOCAL_ENTITY> The type of base entity. * @param <PK> The type of primary key. * @param <REFERRER_CB> The type of referrer condition-bean. * @param <REFERRER_ENTITY> The type of referrer entity. * @param localEntityList The list of local entity. (NotNull) * @param loadReferrerOption The option of loadReferrer. (NotNull) * @param callback The internal call-back of loadReferrer. (NotNull) */ protected virtual void DoHelpLoadReferrerInternally <LOCAL_ENTITY, PK, REFERRER_CB, REFERRER_ENTITY>( IList <LOCAL_ENTITY> localEntityList , LoadReferrerOption <REFERRER_CB, REFERRER_ENTITY> loadReferrerOption , InternalLoadReferrerCallback <LOCAL_ENTITY, PK, REFERRER_CB, REFERRER_ENTITY> callback) where LOCAL_ENTITY : Entity where REFERRER_CB : ConditionBean where REFERRER_ENTITY : Entity { // - - - - - - - - - - - // Assert pre-condition // - - - - - - - - - - - AssertBehaviorSelectorNotNull("loadReferrer"); AssertObjectNotNull("localEntityList", localEntityList); AssertObjectNotNull("loadReferrerOption", loadReferrerOption); if (localEntityList.Count == 0) { return; } // - - - - - - - - - - - - - - // Prepare temporary container // - - - - - - - - - - - - - - IDictionary <PK, LOCAL_ENTITY> pkLocalEntityMap = new Dictionary <PK, LOCAL_ENTITY>(); IList <PK> pkList = new List <PK>(); foreach (LOCAL_ENTITY localEntity in localEntityList) { PK primaryKeyValue = callback.getPKVal(localEntity); if (primaryKeyValue == null) { String msg = "PK value of local entity should not be null: " + localEntity; throw new SystemException(msg); } pkList.Add(primaryKeyValue); if (!pkLocalEntityMap.ContainsKey(primaryKeyValue)) { pkLocalEntityMap.Add(ToLoadReferrerMappingKey(primaryKeyValue), localEntity); } } // - - - - - - - - - - - - - - - - // Prepare referrer condition bean // - - - - - - - - - - - - - - - - REFERRER_CB cb; if (loadReferrerOption.ReferrerConditionBean != null) { cb = loadReferrerOption.ReferrerConditionBean; } else { cb = callback.newMyCB(); } // - - - - - - - - - - - - - - // Select the list of referrer // - - - - - - - - - - - - - - callback.qyFKIn(cb, pkList); cb.xregisterUnionQuerySynchronizer(delegate(ConditionBean unionCB) { REFERRER_CB referrerUnionCB = (REFERRER_CB)unionCB; // for when application uses union query in condition-bean set-upper. callback.qyFKIn(referrerUnionCB, pkList); }); if (pkList.Count > 1) { callback.qyOdFKAsc(cb); cb.SqlComponentOfOrderByClause.exchangeFirstOrderByElementForLastOne(); } loadReferrerOption.delegateConditionBeanSettingUp(cb); if (cb.SqlClause.hasSpecifiedSelectColumn(cb.SqlClause.getBasePointAliasName())) { callback.spFKCol(cb); // specify required columns } IList <REFERRER_ENTITY> referrerList = callback.selRfLs(cb); loadReferrerOption.delegateEntitySettingUp(referrerList); // - - - - - - - - - - - - - - - - - - - - - - - - // Create the map of {primary key / referrer list} // - - - - - - - - - - - - - - - - - - - - - - - - IDictionary <PK, List <REFERRER_ENTITY> > pkReferrerListMap = new Dictionary <PK, List <REFERRER_ENTITY> >(); foreach (REFERRER_ENTITY referrerEntity in referrerList) { PK referrerListKey; { PK foreignKeyValue = callback.getFKVal(referrerEntity); referrerListKey = ToLoadReferrerMappingKey(foreignKeyValue); } if (!pkReferrerListMap.ContainsKey(referrerListKey)) { pkReferrerListMap.Add(referrerListKey, new List <REFERRER_ENTITY>()); } pkReferrerListMap[referrerListKey].Add(referrerEntity); // for Reverse Reference. LOCAL_ENTITY localEntity = pkLocalEntityMap[referrerListKey]; callback.setlcEt(referrerEntity, localEntity); } // - - - - - - - - - - - - - - - - - - // Relate referrer list to base entity // - - - - - - - - - - - - - - - - - - foreach (LOCAL_ENTITY localEntity in localEntityList) { PK referrerListKey; { PK primaryKey = callback.getPKVal(localEntity); referrerListKey = ToLoadReferrerMappingKey(primaryKey); } if (pkReferrerListMap.ContainsKey(referrerListKey)) { callback.setRfLs(localEntity, pkReferrerListMap[referrerListKey]); } else { callback.setRfLs(localEntity, new List <REFERRER_ENTITY>()); } } }
public virtual void LoadMst画面マスタList(Kbnメニュー区分 kbnメニュー区分, LoadReferrerOption <Mst画面マスタCB, Mst画面マスタ> loadReferrerOption) { AssertObjectNotNull("kbnメニュー区分", kbnメニュー区分); AssertObjectNotNull("loadReferrerOption", loadReferrerOption); LoadMst画面マスタList(xnewLRLs <Kbnメニュー区分>(kbnメニュー区分), loadReferrerOption); }
public virtual void LoadDch客室利用台帳List(Kbn客室利用区分 kbn客室利用区分, LoadReferrerOption <Dch客室利用台帳CB, Dch客室利用台帳> loadReferrerOption) { AssertObjectNotNull("kbn客室利用区分", kbn客室利用区分); AssertObjectNotNull("loadReferrerOption", loadReferrerOption); LoadDch客室利用台帳List(xnewLRLs <Kbn客室利用区分>(kbn客室利用区分), loadReferrerOption); }
public virtual void LoadMst客室マスタList(Mst客室タイプマスタ mst客室タイプマスタ, LoadReferrerOption <Mst客室マスタCB, Mst客室マスタ> loadReferrerOption) { AssertObjectNotNull("mst客室タイプマスタ", mst客室タイプマスタ); AssertObjectNotNull("loadReferrerOption", loadReferrerOption); LoadMst客室マスタList(xnewLRLs <Mst客室タイプマスタ>(mst客室タイプマスタ), loadReferrerOption); }