public ICFSecurityISOCountryObj readISOCountryByNameIdx(String Name, boolean forceRead) { if (indexByNameIdx == null) { indexByNameIdx = new HashMap<CFSecurityISOCountryByNameIdxKey, ICFSecurityISOCountryObj>(); } CFSecurityISOCountryByNameIdxKey key = ((ICFInternetSchema) schema.getBackingStore()).getFactoryISOCountry().newNameIdxKey(); key.setRequiredName(Name); ICFSecurityISOCountryObj obj = null; if ((!forceRead) && indexByNameIdx.containsKey(key)) { obj = indexByNameIdx.get(key); } else { CFSecurityISOCountryBuff buff = ((ICFInternetSchema) schema.getBackingStore()) .getTableISOCountry() .readDerivedByNameIdx(schema.getAuthorization(), Name); if (buff != null) { obj = schema.getISOCountryTableObj().newInstance(); obj.setPKey( ((ICFInternetSchema) schema.getBackingStore()).getFactoryISOCountry().newPKey()); obj.setBuff(buff); obj = (ICFSecurityISOCountryObj) obj.realize(); } else if (schema.getCacheMisses()) { indexByNameIdx.put(key, null); } } return (obj); }
public void forgetISOCountryByNameIdx(String Name) { if (indexByNameIdx == null) { return; } CFSecurityISOCountryByNameIdxKey key = ((ICFInternetSchema) schema.getBackingStore()).getFactoryISOCountry().newNameIdxKey(); key.setRequiredName(Name); if (indexByNameIdx.containsKey(key)) { ICFSecurityISOCountryObj probed = indexByNameIdx.get(key); if (probed != null) { probed.forget(true); } indexByNameIdx.remove(key); } }
public void deleteISOCountryByNameIdx(String Name) { if (indexByNameIdx == null) { indexByNameIdx = new HashMap<CFSecurityISOCountryByNameIdxKey, ICFSecurityISOCountryObj>(); } CFSecurityISOCountryByNameIdxKey key = ((ICFInternetSchema) schema.getBackingStore()).getFactoryISOCountry().newNameIdxKey(); key.setRequiredName(Name); ICFSecurityISOCountryObj obj = null; if (indexByNameIdx.containsKey(key)) { obj = indexByNameIdx.get(key); ((ICFInternetSchema) schema.getBackingStore()) .getTableISOCountry() .deleteISOCountryByNameIdx(schema.getAuthorization(), Name); obj.forget(true); } else { ((ICFInternetSchema) schema.getBackingStore()) .getTableISOCountry() .deleteISOCountryByNameIdx(schema.getAuthorization(), Name); } }
public void forgetISOCountry(ICFSecurityISOCountryObj Obj, boolean forgetSubObjects) { ICFSecurityISOCountryObj obj = Obj; CFSecurityISOCountryPKey pkey = obj.getPKey(); if (members.containsKey(pkey)) { ICFSecurityISOCountryObj keepObj = members.get(pkey); // Detach object from alternate, duplicate, all and PKey indexes if (indexByISOCodeIdx != null) { CFSecurityISOCountryByISOCodeIdxKey keyISOCodeIdx = ((ICFInternetSchema) schema.getBackingStore()) .getFactoryISOCountry() .newISOCodeIdxKey(); keyISOCodeIdx.setRequiredISOCode(keepObj.getRequiredISOCode()); indexByISOCodeIdx.remove(keyISOCodeIdx); } if (indexByNameIdx != null) { CFSecurityISOCountryByNameIdxKey keyNameIdx = ((ICFInternetSchema) schema.getBackingStore()).getFactoryISOCountry().newNameIdxKey(); keyNameIdx.setRequiredName(keepObj.getRequiredName()); indexByNameIdx.remove(keyNameIdx); } if (allISOCountry != null) { allISOCountry.remove(keepObj.getPKey()); } members.remove(pkey); if (forgetSubObjects) { ((ICFSecuritySchemaObj) schema) .getISOCountryCurrencyTableObj() .forgetISOCountryCurrencyByCountryIdx(keepObj.getRequiredId()); ((ICFSecuritySchemaObj) schema) .getISOCountryLanguageTableObj() .forgetISOCountryLanguageByCountryIdx(keepObj.getRequiredId()); } } }
public ICFSecurityISOCountryObj realizeISOCountry(ICFSecurityISOCountryObj Obj) { ICFSecurityISOCountryObj obj = Obj; CFSecurityISOCountryPKey pkey = obj.getPKey(); ICFSecurityISOCountryObj keepObj = null; if (members.containsKey(pkey) && (null != members.get(pkey))) { ICFSecurityISOCountryObj existingObj = members.get(pkey); keepObj = existingObj; /* * We always rebind the data because if we're being called, some index has * been updated and is refreshing it's data, which may or may not have changed */ // Detach object from alternate and duplicate indexes, leave PKey alone if (indexByISOCodeIdx != null) { CFSecurityISOCountryByISOCodeIdxKey keyISOCodeIdx = ((ICFInternetSchema) schema.getBackingStore()) .getFactoryISOCountry() .newISOCodeIdxKey(); keyISOCodeIdx.setRequiredISOCode(keepObj.getRequiredISOCode()); indexByISOCodeIdx.remove(keyISOCodeIdx); } if (indexByNameIdx != null) { CFSecurityISOCountryByNameIdxKey keyNameIdx = ((ICFInternetSchema) schema.getBackingStore()).getFactoryISOCountry().newNameIdxKey(); keyNameIdx.setRequiredName(keepObj.getRequiredName()); indexByNameIdx.remove(keyNameIdx); } keepObj.setBuff(Obj.getBuff()); // Attach new object to alternate and duplicate indexes -- PKey stay stable if (indexByISOCodeIdx != null) { CFSecurityISOCountryByISOCodeIdxKey keyISOCodeIdx = ((ICFInternetSchema) schema.getBackingStore()) .getFactoryISOCountry() .newISOCodeIdxKey(); keyISOCodeIdx.setRequiredISOCode(keepObj.getRequiredISOCode()); indexByISOCodeIdx.put(keyISOCodeIdx, keepObj); } if (indexByNameIdx != null) { CFSecurityISOCountryByNameIdxKey keyNameIdx = ((ICFInternetSchema) schema.getBackingStore()).getFactoryISOCountry().newNameIdxKey(); keyNameIdx.setRequiredName(keepObj.getRequiredName()); indexByNameIdx.put(keyNameIdx, keepObj); } if (allISOCountry != null) { allISOCountry.put(keepObj.getPKey(), keepObj); } } else { keepObj = obj; keepObj.setIsNew(false); // Attach new object to PKey, all, alternate, and duplicate indexes members.put(keepObj.getPKey(), keepObj); if (allISOCountry != null) { allISOCountry.put(keepObj.getPKey(), keepObj); } if (indexByISOCodeIdx != null) { CFSecurityISOCountryByISOCodeIdxKey keyISOCodeIdx = ((ICFInternetSchema) schema.getBackingStore()) .getFactoryISOCountry() .newISOCodeIdxKey(); keyISOCodeIdx.setRequiredISOCode(keepObj.getRequiredISOCode()); indexByISOCodeIdx.put(keyISOCodeIdx, keepObj); } if (indexByNameIdx != null) { CFSecurityISOCountryByNameIdxKey keyNameIdx = ((ICFInternetSchema) schema.getBackingStore()).getFactoryISOCountry().newNameIdxKey(); keyNameIdx.setRequiredName(keepObj.getRequiredName()); indexByNameIdx.put(keyNameIdx, keepObj); } } return (keepObj); }