public void forgetSecDevice(ICFSecuritySecDeviceObj Obj, boolean forgetSubObjects) { ICFSecuritySecDeviceObj obj = Obj; CFSecuritySecDevicePKey pkey = obj.getPKey(); if (members.containsKey(pkey)) { ICFSecuritySecDeviceObj keepObj = members.get(pkey); // Detach object from alternate, duplicate, all and PKey indexes if (indexByUserIdx != null) { CFSecuritySecDeviceByUserIdxKey keyUserIdx = ((ICFAsteriskSchema) schema.getBackingStore()).getFactorySecDevice().newUserIdxKey(); keyUserIdx.setRequiredSecUserId(keepObj.getRequiredSecUserId()); Map<CFSecuritySecDevicePKey, ICFSecuritySecDeviceObj> mapUserIdx = indexByUserIdx.get(keyUserIdx); if (mapUserIdx != null) { mapUserIdx.remove(keepObj.getPKey()); } } if (allSecDevice != null) { allSecDevice.remove(keepObj.getPKey()); } members.remove(pkey); if (forgetSubObjects) {} } }
public ICFSecuritySecDeviceObj realizeSecDevice(ICFSecuritySecDeviceObj Obj) { ICFSecuritySecDeviceObj obj = Obj; CFSecuritySecDevicePKey pkey = obj.getPKey(); ICFSecuritySecDeviceObj keepObj = null; if (members.containsKey(pkey) && (null != members.get(pkey))) { ICFSecuritySecDeviceObj 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 (indexByUserIdx != null) { CFSecuritySecDeviceByUserIdxKey keyUserIdx = ((ICFAsteriskSchema) schema.getBackingStore()).getFactorySecDevice().newUserIdxKey(); keyUserIdx.setRequiredSecUserId(keepObj.getRequiredSecUserId()); Map<CFSecuritySecDevicePKey, ICFSecuritySecDeviceObj> mapUserIdx = indexByUserIdx.get(keyUserIdx); if (mapUserIdx != null) { mapUserIdx.remove(keepObj.getPKey()); } } keepObj.setBuff(Obj.getBuff()); // Attach new object to alternate and duplicate indexes -- PKey stay stable if (indexByUserIdx != null) { CFSecuritySecDeviceByUserIdxKey keyUserIdx = ((ICFAsteriskSchema) schema.getBackingStore()).getFactorySecDevice().newUserIdxKey(); keyUserIdx.setRequiredSecUserId(keepObj.getRequiredSecUserId()); Map<CFSecuritySecDevicePKey, ICFSecuritySecDeviceObj> mapUserIdx = indexByUserIdx.get(keyUserIdx); if (mapUserIdx != null) { mapUserIdx.put(keepObj.getPKey(), keepObj); } } if (allSecDevice != null) { allSecDevice.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 (allSecDevice != null) { allSecDevice.put(keepObj.getPKey(), keepObj); } if (indexByUserIdx != null) { CFSecuritySecDeviceByUserIdxKey keyUserIdx = ((ICFAsteriskSchema) schema.getBackingStore()).getFactorySecDevice().newUserIdxKey(); keyUserIdx.setRequiredSecUserId(keepObj.getRequiredSecUserId()); Map<CFSecuritySecDevicePKey, ICFSecuritySecDeviceObj> mapUserIdx = indexByUserIdx.get(keyUserIdx); if (mapUserIdx != null) { mapUserIdx.put(keepObj.getPKey(), keepObj); } } } return (keepObj); }