public void deleteMemoByMemoContactIdx(long TenantId, long ContactId) {
   CFCrmMemoByMemoContactIdxKey key =
       ((ICFAccSchema) schema.getBackingStore()).getFactoryMemo().newMemoContactIdxKey();
   key.setRequiredTenantId(TenantId);
   key.setRequiredContactId(ContactId);
   if (indexByMemoContactIdx == null) {
     indexByMemoContactIdx =
         new HashMap<CFCrmMemoByMemoContactIdxKey, Map<CFCrmMemoPKey, ICFCrmMemoObj>>();
   }
   if (indexByMemoContactIdx.containsKey(key)) {
     Map<CFCrmMemoPKey, ICFCrmMemoObj> dict = indexByMemoContactIdx.get(key);
     ((ICFAccSchema) schema.getBackingStore())
         .getTableMemo()
         .deleteMemoByMemoContactIdx(schema.getAuthorization(), TenantId, ContactId);
     Iterator<ICFCrmMemoObj> iter = dict.values().iterator();
     ICFCrmMemoObj obj;
     List<ICFCrmMemoObj> toForget = new LinkedList<ICFCrmMemoObj>();
     while (iter.hasNext()) {
       obj = iter.next();
       toForget.add(obj);
     }
     iter = toForget.iterator();
     while (iter.hasNext()) {
       obj = iter.next();
       obj.forget(true);
     }
     indexByMemoContactIdx.remove(key);
   } else {
     ((ICFAccSchema) schema.getBackingStore())
         .getTableMemo()
         .deleteMemoByMemoContactIdx(schema.getAuthorization(), TenantId, ContactId);
   }
 }
 public void deleteMemoByIdIdx(long TenantId, long MemoId) {
   CFCrmMemoPKey pkey = ((ICFAccSchema) schema.getBackingStore()).getFactoryMemo().newPKey();
   pkey.setRequiredTenantId(TenantId);
   pkey.setRequiredMemoId(MemoId);
   ICFCrmMemoObj obj = readMemo(pkey);
   if (obj != null) {
     ICFCrmMemoEditObj editObj = (ICFCrmMemoEditObj) obj.getEdit();
     boolean editStarted;
     if (editObj == null) {
       editObj = (ICFCrmMemoEditObj) obj.beginEdit();
       if (editObj != null) {
         editStarted = true;
       } else {
         editStarted = false;
       }
     } else {
       editStarted = false;
     }
     if (editObj != null) {
       editObj.delete();
       if (editStarted) {
         editObj.endEdit();
       }
     }
     obj.forget(true);
   }
 }
 public void deleteMemo(ICFCrmMemoObj Obj) {
   ICFCrmMemoObj obj = Obj;
   ((ICFAccSchema) schema.getBackingStore())
       .getTableMemo()
       .deleteMemo(schema.getAuthorization(), obj.getMemoBuff());
   obj.forget(true);
 }
  public void forgetMemoByMemoContactIdx(long TenantId, long ContactId) {
    if (indexByMemoContactIdx == null) {
      return;
    }
    CFCrmMemoByMemoContactIdxKey key =
        ((ICFAccSchema) schema.getBackingStore()).getFactoryMemo().newMemoContactIdxKey();
    key.setRequiredTenantId(TenantId);
    key.setRequiredContactId(ContactId);
    if (indexByMemoContactIdx.containsKey(key)) {
      Map<CFCrmMemoPKey, ICFCrmMemoObj> mapMemoContactIdx = indexByMemoContactIdx.get(key);
      if (mapMemoContactIdx != null) {
        List<ICFCrmMemoObj> toForget = new LinkedList<ICFCrmMemoObj>();
        ICFCrmMemoObj cur = null;
        Iterator<ICFCrmMemoObj> iter = mapMemoContactIdx.values().iterator();
        while (iter.hasNext()) {
          cur = iter.next();
          toForget.add(cur);
        }
        iter = toForget.iterator();
        while (iter.hasNext()) {
          cur = iter.next();
          cur.forget(true);
        }
      }

      indexByMemoContactIdx.remove(key);
    }
  }
 public void forgetMemoByIdIdx(long TenantId, long MemoId) {
   if (members == null) {
     return;
   }
   CFCrmMemoPKey key = ((ICFAccSchema) schema.getBackingStore()).getFactoryMemo().newPKey();
   key.setRequiredTenantId(TenantId);
   key.setRequiredMemoId(MemoId);
   if (members.containsKey(key)) {
     ICFCrmMemoObj probed = members.get(key);
     if (probed != null) {
       probed.forget(true);
     }
   }
 }
  public void forgetMemoByUDescrIdx(long TenantId, long ContactId, String Description) {
    if (indexByUDescrIdx == null) {
      return;
    }
    CFCrmMemoByUDescrIdxKey key =
        ((ICFAccSchema) schema.getBackingStore()).getFactoryMemo().newUDescrIdxKey();
    key.setRequiredTenantId(TenantId);
    key.setRequiredContactId(ContactId);
    key.setRequiredDescription(Description);
    if (indexByUDescrIdx.containsKey(key)) {
      ICFCrmMemoObj probed = indexByUDescrIdx.get(key);
      if (probed != null) {
        probed.forget(true);
      }

      indexByUDescrIdx.remove(key);
    }
  }
 public void minimizeMemory() {
   allMemo = null;
   indexByTenantIdx = null;
   indexByMemoContactIdx = null;
   indexByUDescrIdx = null;
   List<ICFCrmMemoObj> toForget = new LinkedList<ICFCrmMemoObj>();
   ICFCrmMemoObj cur = null;
   Iterator<ICFCrmMemoObj> iter = members.values().iterator();
   while (iter.hasNext()) {
     cur = iter.next();
     if (cur.getEdit() == null) {
       toForget.add(cur);
     }
   }
   iter = toForget.iterator();
   while (iter.hasNext()) {
     cur = iter.next();
     cur.forget();
   }
 }
 public void deleteMemoByUDescrIdx(long TenantId, long ContactId, String Description) {
   if (indexByUDescrIdx == null) {
     indexByUDescrIdx = new HashMap<CFCrmMemoByUDescrIdxKey, ICFCrmMemoObj>();
   }
   CFCrmMemoByUDescrIdxKey key =
       ((ICFAccSchema) schema.getBackingStore()).getFactoryMemo().newUDescrIdxKey();
   key.setRequiredTenantId(TenantId);
   key.setRequiredContactId(ContactId);
   key.setRequiredDescription(Description);
   ICFCrmMemoObj obj = null;
   if (indexByUDescrIdx.containsKey(key)) {
     obj = indexByUDescrIdx.get(key);
     ((ICFAccSchema) schema.getBackingStore())
         .getTableMemo()
         .deleteMemoByUDescrIdx(schema.getAuthorization(), TenantId, ContactId, Description);
     obj.forget(true);
   } else {
     ((ICFAccSchema) schema.getBackingStore())
         .getTableMemo()
         .deleteMemoByUDescrIdx(schema.getAuthorization(), TenantId, ContactId, Description);
   }
 }