public ICFSecurityServiceTypeObj realizeServiceType(ICFSecurityServiceTypeObj Obj) { ICFSecurityServiceTypeObj obj = Obj; CFSecurityServiceTypePKey pkey = obj.getPKey(); ICFSecurityServiceTypeObj keepObj = null; if (members.containsKey(pkey) && (null != members.get(pkey))) { ICFSecurityServiceTypeObj 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 (indexByUDescrIdx != null) { CFSecurityServiceTypeByUDescrIdxKey keyUDescrIdx = ((ICFAccSchema) schema.getBackingStore()).getFactoryServiceType().newUDescrIdxKey(); keyUDescrIdx.setRequiredDescription(keepObj.getRequiredDescription()); indexByUDescrIdx.remove(keyUDescrIdx); } keepObj.setBuff(Obj.getBuff()); // Attach new object to alternate and duplicate indexes -- PKey stay stable if (indexByUDescrIdx != null) { CFSecurityServiceTypeByUDescrIdxKey keyUDescrIdx = ((ICFAccSchema) schema.getBackingStore()).getFactoryServiceType().newUDescrIdxKey(); keyUDescrIdx.setRequiredDescription(keepObj.getRequiredDescription()); indexByUDescrIdx.put(keyUDescrIdx, keepObj); } if (allServiceType != null) { allServiceType.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 (allServiceType != null) { allServiceType.put(keepObj.getPKey(), keepObj); } if (indexByUDescrIdx != null) { CFSecurityServiceTypeByUDescrIdxKey keyUDescrIdx = ((ICFAccSchema) schema.getBackingStore()).getFactoryServiceType().newUDescrIdxKey(); keyUDescrIdx.setRequiredDescription(keepObj.getRequiredDescription()); indexByUDescrIdx.put(keyUDescrIdx, keepObj); } } return (keepObj); }
public ICFSecurityServiceTypeObj readServiceTypeByUDescrIdx( String Description, boolean forceRead) { if (indexByUDescrIdx == null) { indexByUDescrIdx = new HashMap<CFSecurityServiceTypeByUDescrIdxKey, ICFSecurityServiceTypeObj>(); } CFSecurityServiceTypeByUDescrIdxKey key = ((ICFAccSchema) schema.getBackingStore()).getFactoryServiceType().newUDescrIdxKey(); key.setRequiredDescription(Description); ICFSecurityServiceTypeObj obj = null; if ((!forceRead) && indexByUDescrIdx.containsKey(key)) { obj = indexByUDescrIdx.get(key); } else { CFSecurityServiceTypeBuff buff = ((ICFAccSchema) schema.getBackingStore()) .getTableServiceType() .readDerivedByUDescrIdx(schema.getAuthorization(), Description); if (buff != null) { obj = schema.getServiceTypeTableObj().newInstance(); obj.setPKey(((ICFAccSchema) schema.getBackingStore()).getFactoryServiceType().newPKey()); obj.setBuff(buff); obj = (ICFSecurityServiceTypeObj) obj.realize(); } else if (schema.getCacheMisses()) { indexByUDescrIdx.put(key, null); } } return (obj); }
public void forgetServiceType(ICFSecurityServiceTypeObj Obj, boolean forgetSubObjects) { ICFSecurityServiceTypeObj obj = Obj; CFSecurityServiceTypePKey pkey = obj.getPKey(); if (members.containsKey(pkey)) { ICFSecurityServiceTypeObj keepObj = members.get(pkey); // Detach object from alternate, duplicate, all and PKey indexes if (indexByUDescrIdx != null) { CFSecurityServiceTypeByUDescrIdxKey keyUDescrIdx = ((ICFAccSchema) schema.getBackingStore()).getFactoryServiceType().newUDescrIdxKey(); keyUDescrIdx.setRequiredDescription(keepObj.getRequiredDescription()); indexByUDescrIdx.remove(keyUDescrIdx); } if (allServiceType != null) { allServiceType.remove(keepObj.getPKey()); } members.remove(pkey); if (forgetSubObjects) { ((ICFSecuritySchemaObj) schema) .getServiceTableObj() .forgetServiceByTypeIdx(keepObj.getRequiredServiceTypeId()); } } }
public void forgetServiceTypeByUDescrIdx(String Description) { if (indexByUDescrIdx == null) { return; } CFSecurityServiceTypeByUDescrIdxKey key = ((ICFAccSchema) schema.getBackingStore()).getFactoryServiceType().newUDescrIdxKey(); key.setRequiredDescription(Description); if (indexByUDescrIdx.containsKey(key)) { ICFSecurityServiceTypeObj probed = indexByUDescrIdx.get(key); if (probed != null) { probed.forget(true); } indexByUDescrIdx.remove(key); } }
public void deleteServiceTypeByUDescrIdx(String Description) { if (indexByUDescrIdx == null) { indexByUDescrIdx = new HashMap<CFSecurityServiceTypeByUDescrIdxKey, ICFSecurityServiceTypeObj>(); } CFSecurityServiceTypeByUDescrIdxKey key = ((ICFAccSchema) schema.getBackingStore()).getFactoryServiceType().newUDescrIdxKey(); key.setRequiredDescription(Description); ICFSecurityServiceTypeObj obj = null; if (indexByUDescrIdx.containsKey(key)) { obj = indexByUDescrIdx.get(key); ((ICFAccSchema) schema.getBackingStore()) .getTableServiceType() .deleteServiceTypeByUDescrIdx(schema.getAuthorization(), Description); obj.forget(true); } else { ((ICFAccSchema) schema.getBackingStore()) .getTableServiceType() .deleteServiceTypeByUDescrIdx(schema.getAuthorization(), Description); } }