public void deleteTaxByTenantIdx(long TenantId) { CFAccTaxByTenantIdxKey key = ((ICFAccSchema) schema.getBackingStore()).getFactoryTax().newTenantIdxKey(); key.setRequiredTenantId(TenantId); if (indexByTenantIdx == null) { indexByTenantIdx = new HashMap<CFAccTaxByTenantIdxKey, Map<CFAccTaxPKey, ICFAccTaxObj>>(); } if (indexByTenantIdx.containsKey(key)) { Map<CFAccTaxPKey, ICFAccTaxObj> dict = indexByTenantIdx.get(key); ((ICFAccSchema) schema.getBackingStore()) .getTableTax() .deleteTaxByTenantIdx(schema.getAuthorization(), TenantId); Iterator<ICFAccTaxObj> iter = dict.values().iterator(); ICFAccTaxObj obj; List<ICFAccTaxObj> toForget = new LinkedList<ICFAccTaxObj>(); while (iter.hasNext()) { obj = iter.next(); toForget.add(obj); } iter = toForget.iterator(); while (iter.hasNext()) { obj = iter.next(); obj.forget(true); } indexByTenantIdx.remove(key); } else { ((ICFAccSchema) schema.getBackingStore()) .getTableTax() .deleteTaxByTenantIdx(schema.getAuthorization(), TenantId); } }
public void deleteTaxByIdIdx(long TaxId) { CFAccTaxPKey pkey = ((ICFAccSchema) schema.getBackingStore()).getFactoryTax().newPKey(); pkey.setRequiredTaxId(TaxId); ICFAccTaxObj obj = readTax(pkey); if (obj != null) { ICFAccTaxEditObj editObj = (ICFAccTaxEditObj) obj.getEdit(); boolean editStarted; if (editObj == null) { editObj = (ICFAccTaxEditObj) 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 deleteTax(ICFAccTaxObj Obj) { ICFAccTaxObj obj = Obj; ((ICFAccSchema) schema.getBackingStore()) .getTableTax() .deleteTax(schema.getAuthorization(), obj.getTaxBuff()); obj.forget(true); }
public void forgetTaxByTenantIdx(long TenantId) { if (indexByTenantIdx == null) { return; } CFAccTaxByTenantIdxKey key = ((ICFAccSchema) schema.getBackingStore()).getFactoryTax().newTenantIdxKey(); key.setRequiredTenantId(TenantId); if (indexByTenantIdx.containsKey(key)) { Map<CFAccTaxPKey, ICFAccTaxObj> mapTenantIdx = indexByTenantIdx.get(key); if (mapTenantIdx != null) { List<ICFAccTaxObj> toForget = new LinkedList<ICFAccTaxObj>(); ICFAccTaxObj cur = null; Iterator<ICFAccTaxObj> iter = mapTenantIdx.values().iterator(); while (iter.hasNext()) { cur = iter.next(); toForget.add(cur); } iter = toForget.iterator(); while (iter.hasNext()) { cur = iter.next(); cur.forget(true); } } indexByTenantIdx.remove(key); } }
public void forgetTaxByIdIdx(long TaxId) { if (members == null) { return; } CFAccTaxPKey key = ((ICFAccSchema) schema.getBackingStore()).getFactoryTax().newPKey(); key.setRequiredTaxId(TaxId); if (members.containsKey(key)) { ICFAccTaxObj probed = members.get(key); if (probed != null) { probed.forget(true); } } }
public void minimizeMemory() { allTax = null; indexByTenantIdx = null; indexByUNameIdx = null; List<ICFAccTaxObj> toForget = new LinkedList<ICFAccTaxObj>(); ICFAccTaxObj cur = null; Iterator<ICFAccTaxObj> iter = members.values().iterator(); while (iter.hasNext()) { cur = iter.next(); toForget.add(cur); } iter = toForget.iterator(); while (iter.hasNext()) { cur = iter.next(); cur.forget(); } }
public void forgetTaxByUNameIdx(long TenantId, String Name) { if (indexByUNameIdx == null) { return; } CFAccTaxByUNameIdxKey key = ((ICFAccSchema) schema.getBackingStore()).getFactoryTax().newUNameIdxKey(); key.setRequiredTenantId(TenantId); key.setRequiredName(Name); if (indexByUNameIdx.containsKey(key)) { ICFAccTaxObj probed = indexByUNameIdx.get(key); if (probed != null) { probed.forget(true); } indexByUNameIdx.remove(key); } }
public void deleteTaxByUNameIdx(long TenantId, String Name) { if (indexByUNameIdx == null) { indexByUNameIdx = new HashMap<CFAccTaxByUNameIdxKey, ICFAccTaxObj>(); } CFAccTaxByUNameIdxKey key = ((ICFAccSchema) schema.getBackingStore()).getFactoryTax().newUNameIdxKey(); key.setRequiredTenantId(TenantId); key.setRequiredName(Name); ICFAccTaxObj obj = null; if (indexByUNameIdx.containsKey(key)) { obj = indexByUNameIdx.get(key); ((ICFAccSchema) schema.getBackingStore()) .getTableTax() .deleteTaxByUNameIdx(schema.getAuthorization(), TenantId, Name); obj.forget(true); } else { ((ICFAccSchema) schema.getBackingStore()) .getTableTax() .deleteTaxByUNameIdx(schema.getAuthorization(), TenantId, Name); } }