List of usage examples for java.util SortedMap remove
V remove(Object key);
From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccRam.CFAccRamISOCountryLanguageTable.java
public void updateISOCountryLanguage(CFAccAuthorization Authorization, CFAccISOCountryLanguageBuff Buff) { CFAccISOCountryLanguagePKey pkey = schema.getFactoryISOCountryLanguage().newPKey(); pkey.setRequiredISOCountryId(Buff.getRequiredISOCountryId()); pkey.setRequiredISOLanguageId(Buff.getRequiredISOLanguageId()); CFAccISOCountryLanguageBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateISOCountryLanguage", "Existing record not found", "ISOCountryLanguage", pkey); }/*from w ww . ja v a2s . com*/ if (existing.getRequiredRevision() != Buff.getRequiredRevision()) { throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "updateISOCountryLanguage", pkey); } Buff.setRequiredRevision(Buff.getRequiredRevision() + 1); CFAccISOCountryLanguageByCountryIdxKey existingKeyCountryIdx = schema.getFactoryISOCountryLanguage() .newCountryIdxKey(); existingKeyCountryIdx.setRequiredISOCountryId(existing.getRequiredISOCountryId()); CFAccISOCountryLanguageByCountryIdxKey newKeyCountryIdx = schema.getFactoryISOCountryLanguage() .newCountryIdxKey(); newKeyCountryIdx.setRequiredISOCountryId(Buff.getRequiredISOCountryId()); CFAccISOCountryLanguageByLanguageIdxKey existingKeyLanguageIdx = schema.getFactoryISOCountryLanguage() .newLanguageIdxKey(); existingKeyLanguageIdx.setRequiredISOLanguageId(existing.getRequiredISOLanguageId()); CFAccISOCountryLanguageByLanguageIdxKey newKeyLanguageIdx = schema.getFactoryISOCountryLanguage() .newLanguageIdxKey(); newKeyLanguageIdx.setRequiredISOLanguageId(Buff.getRequiredISOLanguageId()); // Check unique indexes // Validate foreign keys { boolean allNull = true; if (allNull) { if (null == schema.getTableISOCountry().readDerivedByIdIdx(Authorization, Buff.getRequiredISOCountryId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateISOCountryLanguage", "Container", "ISOCountryLanguageCountry", "ISOCountry", null); } } } // Update is valid SortedMap<CFAccISOCountryLanguagePKey, CFAccISOCountryLanguageBuff> subdict; dictByPKey.remove(pkey); dictByPKey.put(pkey, Buff); subdict = dictByCountryIdx.get(existingKeyCountryIdx); if (subdict != null) { subdict.remove(pkey); } if (dictByCountryIdx.containsKey(newKeyCountryIdx)) { subdict = dictByCountryIdx.get(newKeyCountryIdx); } else { subdict = new TreeMap<CFAccISOCountryLanguagePKey, CFAccISOCountryLanguageBuff>(); dictByCountryIdx.put(newKeyCountryIdx, subdict); } subdict.put(pkey, Buff); subdict = dictByLanguageIdx.get(existingKeyLanguageIdx); if (subdict != null) { subdict.remove(pkey); } if (dictByLanguageIdx.containsKey(newKeyLanguageIdx)) { subdict = dictByLanguageIdx.get(newKeyLanguageIdx); } else { subdict = new TreeMap<CFAccISOCountryLanguagePKey, CFAccISOCountryLanguageBuff>(); dictByLanguageIdx.put(newKeyLanguageIdx, subdict); } subdict.put(pkey, Buff); }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstRam.CFAstRamISOCountryCurrencyTable.java
public void updateISOCountryCurrency(CFAstAuthorization Authorization, CFAstISOCountryCurrencyBuff Buff) { CFAstISOCountryCurrencyPKey pkey = schema.getFactoryISOCountryCurrency().newPKey(); pkey.setRequiredISOCountryId(Buff.getRequiredISOCountryId()); pkey.setRequiredISOCurrencyId(Buff.getRequiredISOCurrencyId()); CFAstISOCountryCurrencyBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateISOCountryCurrency", "Existing record not found", "ISOCountryCurrency", pkey); }// w ww .ja va2 s. c om if (existing.getRequiredRevision() != Buff.getRequiredRevision()) { throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "updateISOCountryCurrency", pkey); } Buff.setRequiredRevision(Buff.getRequiredRevision() + 1); CFAstISOCountryCurrencyByCountryIdxKey existingKeyCountryIdx = schema.getFactoryISOCountryCurrency() .newCountryIdxKey(); existingKeyCountryIdx.setRequiredISOCountryId(existing.getRequiredISOCountryId()); CFAstISOCountryCurrencyByCountryIdxKey newKeyCountryIdx = schema.getFactoryISOCountryCurrency() .newCountryIdxKey(); newKeyCountryIdx.setRequiredISOCountryId(Buff.getRequiredISOCountryId()); CFAstISOCountryCurrencyByCurrencyIdxKey existingKeyCurrencyIdx = schema.getFactoryISOCountryCurrency() .newCurrencyIdxKey(); existingKeyCurrencyIdx.setRequiredISOCurrencyId(existing.getRequiredISOCurrencyId()); CFAstISOCountryCurrencyByCurrencyIdxKey newKeyCurrencyIdx = schema.getFactoryISOCountryCurrency() .newCurrencyIdxKey(); newKeyCurrencyIdx.setRequiredISOCurrencyId(Buff.getRequiredISOCurrencyId()); // Check unique indexes // Validate foreign keys { boolean allNull = true; if (allNull) { if (null == schema.getTableISOCountry().readDerivedByIdIdx(Authorization, Buff.getRequiredISOCountryId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateISOCountryCurrency", "Container", "ISOCountryCurrencyCountry", "ISOCountry", null); } } } // Update is valid SortedMap<CFAstISOCountryCurrencyPKey, CFAstISOCountryCurrencyBuff> subdict; dictByPKey.remove(pkey); dictByPKey.put(pkey, Buff); subdict = dictByCountryIdx.get(existingKeyCountryIdx); if (subdict != null) { subdict.remove(pkey); } if (dictByCountryIdx.containsKey(newKeyCountryIdx)) { subdict = dictByCountryIdx.get(newKeyCountryIdx); } else { subdict = new TreeMap<CFAstISOCountryCurrencyPKey, CFAstISOCountryCurrencyBuff>(); dictByCountryIdx.put(newKeyCountryIdx, subdict); } subdict.put(pkey, Buff); subdict = dictByCurrencyIdx.get(existingKeyCurrencyIdx); if (subdict != null) { subdict.remove(pkey); } if (dictByCurrencyIdx.containsKey(newKeyCurrencyIdx)) { subdict = dictByCurrencyIdx.get(newKeyCurrencyIdx); } else { subdict = new TreeMap<CFAstISOCountryCurrencyPKey, CFAstISOCountryCurrencyBuff>(); dictByCurrencyIdx.put(newKeyCurrencyIdx, subdict); } subdict.put(pkey, Buff); }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstRam.CFAstRamISOCountryLanguageTable.java
public void updateISOCountryLanguage(CFAstAuthorization Authorization, CFAstISOCountryLanguageBuff Buff) { CFAstISOCountryLanguagePKey pkey = schema.getFactoryISOCountryLanguage().newPKey(); pkey.setRequiredISOCountryId(Buff.getRequiredISOCountryId()); pkey.setRequiredISOLanguageId(Buff.getRequiredISOLanguageId()); CFAstISOCountryLanguageBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateISOCountryLanguage", "Existing record not found", "ISOCountryLanguage", pkey); }//w w w . j a v a 2 s.c om if (existing.getRequiredRevision() != Buff.getRequiredRevision()) { throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "updateISOCountryLanguage", pkey); } Buff.setRequiredRevision(Buff.getRequiredRevision() + 1); CFAstISOCountryLanguageByCountryIdxKey existingKeyCountryIdx = schema.getFactoryISOCountryLanguage() .newCountryIdxKey(); existingKeyCountryIdx.setRequiredISOCountryId(existing.getRequiredISOCountryId()); CFAstISOCountryLanguageByCountryIdxKey newKeyCountryIdx = schema.getFactoryISOCountryLanguage() .newCountryIdxKey(); newKeyCountryIdx.setRequiredISOCountryId(Buff.getRequiredISOCountryId()); CFAstISOCountryLanguageByLanguageIdxKey existingKeyLanguageIdx = schema.getFactoryISOCountryLanguage() .newLanguageIdxKey(); existingKeyLanguageIdx.setRequiredISOLanguageId(existing.getRequiredISOLanguageId()); CFAstISOCountryLanguageByLanguageIdxKey newKeyLanguageIdx = schema.getFactoryISOCountryLanguage() .newLanguageIdxKey(); newKeyLanguageIdx.setRequiredISOLanguageId(Buff.getRequiredISOLanguageId()); // Check unique indexes // Validate foreign keys { boolean allNull = true; if (allNull) { if (null == schema.getTableISOCountry().readDerivedByIdIdx(Authorization, Buff.getRequiredISOCountryId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateISOCountryLanguage", "Container", "ISOCountryLanguageCountry", "ISOCountry", null); } } } // Update is valid SortedMap<CFAstISOCountryLanguagePKey, CFAstISOCountryLanguageBuff> subdict; dictByPKey.remove(pkey); dictByPKey.put(pkey, Buff); subdict = dictByCountryIdx.get(existingKeyCountryIdx); if (subdict != null) { subdict.remove(pkey); } if (dictByCountryIdx.containsKey(newKeyCountryIdx)) { subdict = dictByCountryIdx.get(newKeyCountryIdx); } else { subdict = new TreeMap<CFAstISOCountryLanguagePKey, CFAstISOCountryLanguageBuff>(); dictByCountryIdx.put(newKeyCountryIdx, subdict); } subdict.put(pkey, Buff); subdict = dictByLanguageIdx.get(existingKeyLanguageIdx); if (subdict != null) { subdict.remove(pkey); } if (dictByLanguageIdx.containsKey(newKeyLanguageIdx)) { subdict = dictByLanguageIdx.get(newKeyLanguageIdx); } else { subdict = new TreeMap<CFAstISOCountryLanguagePKey, CFAstISOCountryLanguageBuff>(); dictByLanguageIdx.put(newKeyLanguageIdx, subdict); } subdict.put(pkey, Buff); }
From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccRam.CFAccRamAccountContactTable.java
public void deleteAccountContact(CFAccAuthorization Authorization, CFAccAccountContactBuff Buff) { final String S_ProcName = "CFAccRamAccountContactTable.deleteAccountContact() "; CFAccAccountContactPKey pkey = schema.getFactoryAccountContact().newPKey(); pkey.setRequiredTenantId(Buff.getRequiredTenantId()); pkey.setRequiredAccountId(Buff.getRequiredAccountId()); CFAccAccountContactBuff existing = dictByPKey.get(pkey); if (existing == null) { return;/*ww w.j a v a 2 s.co m*/ } if (existing.getRequiredRevision() != Buff.getRequiredRevision()) { throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteAccountContact", pkey); } CFAccAccountContactByTenantIdxKey keyTenantIdx = schema.getFactoryAccountContact().newTenantIdxKey(); keyTenantIdx.setRequiredTenantId(existing.getRequiredTenantId()); CFAccAccountContactByCtctLstIdxKey keyCtctLstIdx = schema.getFactoryAccountContact().newCtctLstIdxKey(); keyCtctLstIdx.setRequiredTenantId(existing.getRequiredTenantId()); keyCtctLstIdx.setRequiredContactListId(existing.getRequiredContactListId()); CFAccAccountContactByCtctIdxKey keyCtctIdx = schema.getFactoryAccountContact().newCtctIdxKey(); keyCtctIdx.setRequiredTenantId(existing.getRequiredTenantId()); keyCtctIdx.setRequiredContactId(existing.getRequiredContactId()); // Validate reverse foreign keys // Delete is valid SortedMap<CFAccAccountContactPKey, CFAccAccountContactBuff> subdict; dictByPKey.remove(pkey); subdict = dictByTenantIdx.get(keyTenantIdx); subdict.remove(pkey); subdict = dictByCtctLstIdx.get(keyCtctLstIdx); subdict.remove(pkey); subdict = dictByCtctIdx.get(keyCtctIdx); subdict.remove(pkey); }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstRam.CFAstRamVoicemailConfTable.java
public void updateVoicemailConf(CFAstAuthorization Authorization, CFAstVoicemailConfBuff Buff) { schema.getTableConfigurationFile().updateConfigurationFile(Authorization, Buff); CFAstConfigurationFilePKey pkey = schema.getFactoryConfigurationFile().newPKey(); pkey.setRequiredClusterId(Buff.getRequiredClusterId()); pkey.setRequiredId(Buff.getRequiredId()); CFAstVoicemailConfBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateVoicemailConf", "Existing record not found", "VoicemailConf", pkey); }/*from w w w .ja v a 2 s. com*/ CFAstVoicemailConfByVMClusterIdxKey existingKeyVMClusterIdx = schema.getFactoryVoicemailConf() .newVMClusterIdxKey(); existingKeyVMClusterIdx.setRequiredClusterId(existing.getRequiredClusterId()); CFAstVoicemailConfByVMClusterIdxKey newKeyVMClusterIdx = schema.getFactoryVoicemailConf() .newVMClusterIdxKey(); newKeyVMClusterIdx.setRequiredClusterId(Buff.getRequiredClusterId()); // Check unique indexes // Validate foreign keys { boolean allNull = true; if (allNull) { if (null == schema.getTableConfigurationFile().readDerivedByIdIdx(Authorization, Buff.getRequiredClusterId(), Buff.getRequiredId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateVoicemailConf", "Superclass", "SuperClass", "ConfigurationFile", null); } } } // Update is valid SortedMap<CFAstConfigurationFilePKey, CFAstVoicemailConfBuff> subdict; dictByPKey.remove(pkey); dictByPKey.put(pkey, Buff); subdict = dictByVMClusterIdx.get(existingKeyVMClusterIdx); if (subdict != null) { subdict.remove(pkey); } if (dictByVMClusterIdx.containsKey(newKeyVMClusterIdx)) { subdict = dictByVMClusterIdx.get(newKeyVMClusterIdx); } else { subdict = new TreeMap<CFAstConfigurationFilePKey, CFAstVoicemailConfBuff>(); dictByVMClusterIdx.put(newKeyVMClusterIdx, subdict); } subdict.put(pkey, Buff); }
From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccRam.CFAccRamAttachmentTagTable.java
public void deleteAttachmentTag(CFAccAuthorization Authorization, CFAccAttachmentTagBuff Buff) { final String S_ProcName = "CFAccRamAttachmentTagTable.deleteAttachmentTag() "; CFAccAttachmentTagPKey pkey = schema.getFactoryAttachmentTag().newPKey(); pkey.setRequiredTenantId(Buff.getRequiredTenantId()); pkey.setRequiredAttachmentId(Buff.getRequiredAttachmentId()); pkey.setRequiredTagId(Buff.getRequiredTagId()); CFAccAttachmentTagBuff existing = dictByPKey.get(pkey); if (existing == null) { return;/*from w w w . jav a2 s .c o m*/ } if (existing.getRequiredRevision() != Buff.getRequiredRevision()) { throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteAttachmentTag", pkey); } CFAccAttachmentTagByTenantIdxKey keyTenantIdx = schema.getFactoryAttachmentTag().newTenantIdxKey(); keyTenantIdx.setRequiredTenantId(existing.getRequiredTenantId()); CFAccAttachmentTagByAttIdxKey keyAttIdx = schema.getFactoryAttachmentTag().newAttIdxKey(); keyAttIdx.setRequiredTenantId(existing.getRequiredTenantId()); keyAttIdx.setRequiredAttachmentId(existing.getRequiredAttachmentId()); CFAccAttachmentTagByTagIdxKey keyTagIdx = schema.getFactoryAttachmentTag().newTagIdxKey(); keyTagIdx.setRequiredTenantId(existing.getRequiredTenantId()); keyTagIdx.setRequiredTagId(existing.getRequiredTagId()); // Validate reverse foreign keys // Delete is valid SortedMap<CFAccAttachmentTagPKey, CFAccAttachmentTagBuff> subdict; dictByPKey.remove(pkey); subdict = dictByTenantIdx.get(keyTenantIdx); subdict.remove(pkey); subdict = dictByAttIdx.get(keyAttIdx); subdict.remove(pkey); subdict = dictByTagIdx.get(keyTagIdx); subdict.remove(pkey); }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstRam.CFAstRamAsteriskConfTable.java
public void updateAsteriskConf(CFAstAuthorization Authorization, CFAstAsteriskConfBuff Buff) { schema.getTableConfigurationFile().updateConfigurationFile(Authorization, Buff); CFAstConfigurationFilePKey pkey = schema.getFactoryConfigurationFile().newPKey(); pkey.setRequiredClusterId(Buff.getRequiredClusterId()); pkey.setRequiredId(Buff.getRequiredId()); CFAstAsteriskConfBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateAsteriskConf", "Existing record not found", "AsteriskConf", pkey); }/*www .jav a2 s. c o m*/ CFAstAsteriskConfByConfClusterIdxKey existingKeyConfClusterIdx = schema.getFactoryAsteriskConf() .newConfClusterIdxKey(); existingKeyConfClusterIdx.setRequiredClusterId(existing.getRequiredClusterId()); CFAstAsteriskConfByConfClusterIdxKey newKeyConfClusterIdx = schema.getFactoryAsteriskConf() .newConfClusterIdxKey(); newKeyConfClusterIdx.setRequiredClusterId(Buff.getRequiredClusterId()); // Check unique indexes // Validate foreign keys { boolean allNull = true; if (allNull) { if (null == schema.getTableConfigurationFile().readDerivedByIdIdx(Authorization, Buff.getRequiredClusterId(), Buff.getRequiredId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateAsteriskConf", "Superclass", "SuperClass", "ConfigurationFile", null); } } } // Update is valid SortedMap<CFAstConfigurationFilePKey, CFAstAsteriskConfBuff> subdict; dictByPKey.remove(pkey); dictByPKey.put(pkey, Buff); subdict = dictByConfClusterIdx.get(existingKeyConfClusterIdx); if (subdict != null) { subdict.remove(pkey); } if (dictByConfClusterIdx.containsKey(newKeyConfClusterIdx)) { subdict = dictByConfClusterIdx.get(newKeyConfClusterIdx); } else { subdict = new TreeMap<CFAstConfigurationFilePKey, CFAstAsteriskConfBuff>(); dictByConfClusterIdx.put(newKeyConfClusterIdx, subdict); } subdict.put(pkey, Buff); }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstRam.CFAstRamExtConfigConfTable.java
public void updateExtConfigConf(CFAstAuthorization Authorization, CFAstExtConfigConfBuff Buff) { schema.getTableConfigurationFile().updateConfigurationFile(Authorization, Buff); CFAstConfigurationFilePKey pkey = schema.getFactoryConfigurationFile().newPKey(); pkey.setRequiredClusterId(Buff.getRequiredClusterId()); pkey.setRequiredId(Buff.getRequiredId()); CFAstExtConfigConfBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateExtConfigConf", "Existing record not found", "ExtConfigConf", pkey); }//from www. j ava 2s.com CFAstExtConfigConfByExtCnfClusIdxKey existingKeyExtCnfClusIdx = schema.getFactoryExtConfigConf() .newExtCnfClusIdxKey(); existingKeyExtCnfClusIdx.setRequiredClusterId(existing.getRequiredClusterId()); CFAstExtConfigConfByExtCnfClusIdxKey newKeyExtCnfClusIdx = schema.getFactoryExtConfigConf() .newExtCnfClusIdxKey(); newKeyExtCnfClusIdx.setRequiredClusterId(Buff.getRequiredClusterId()); // Check unique indexes // Validate foreign keys { boolean allNull = true; if (allNull) { if (null == schema.getTableConfigurationFile().readDerivedByIdIdx(Authorization, Buff.getRequiredClusterId(), Buff.getRequiredId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateExtConfigConf", "Superclass", "SuperClass", "ConfigurationFile", null); } } } // Update is valid SortedMap<CFAstConfigurationFilePKey, CFAstExtConfigConfBuff> subdict; dictByPKey.remove(pkey); dictByPKey.put(pkey, Buff); subdict = dictByExtCnfClusIdx.get(existingKeyExtCnfClusIdx); if (subdict != null) { subdict.remove(pkey); } if (dictByExtCnfClusIdx.containsKey(newKeyExtCnfClusIdx)) { subdict = dictByExtCnfClusIdx.get(newKeyExtCnfClusIdx); } else { subdict = new TreeMap<CFAstConfigurationFilePKey, CFAstExtConfigConfBuff>(); dictByExtCnfClusIdx.put(newKeyExtCnfClusIdx, subdict); } subdict.put(pkey, Buff); }
From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccRam.CFAccRamISOTimezoneTable.java
public void updateISOTimezone(CFAccAuthorization Authorization, CFAccISOTimezoneBuff Buff) { CFAccISOTimezonePKey pkey = schema.getFactoryISOTimezone().newPKey(); pkey.setRequiredISOTimezoneId(Buff.getRequiredISOTimezoneId()); CFAccISOTimezoneBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateISOTimezone", "Existing record not found", "ISOTimezone", pkey); }//from ww w .j a va2 s .c o m if (existing.getRequiredRevision() != Buff.getRequiredRevision()) { throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "updateISOTimezone", pkey); } Buff.setRequiredRevision(Buff.getRequiredRevision() + 1); CFAccISOTimezoneByOffsetIdxKey existingKeyOffsetIdx = schema.getFactoryISOTimezone().newOffsetIdxKey(); existingKeyOffsetIdx.setRequiredTZHourOffset(existing.getRequiredTZHourOffset()); existingKeyOffsetIdx.setRequiredTZMinOffset(existing.getRequiredTZMinOffset()); CFAccISOTimezoneByOffsetIdxKey newKeyOffsetIdx = schema.getFactoryISOTimezone().newOffsetIdxKey(); newKeyOffsetIdx.setRequiredTZHourOffset(Buff.getRequiredTZHourOffset()); newKeyOffsetIdx.setRequiredTZMinOffset(Buff.getRequiredTZMinOffset()); CFAccISOTimezoneByUTZNameIdxKey existingKeyUTZNameIdx = schema.getFactoryISOTimezone().newUTZNameIdxKey(); existingKeyUTZNameIdx.setRequiredTZName(existing.getRequiredTZName()); CFAccISOTimezoneByUTZNameIdxKey newKeyUTZNameIdx = schema.getFactoryISOTimezone().newUTZNameIdxKey(); newKeyUTZNameIdx.setRequiredTZName(Buff.getRequiredTZName()); CFAccISOTimezoneByIso8601IdxKey existingKeyIso8601Idx = schema.getFactoryISOTimezone().newIso8601IdxKey(); existingKeyIso8601Idx.setRequiredIso8601(existing.getRequiredIso8601()); CFAccISOTimezoneByIso8601IdxKey newKeyIso8601Idx = schema.getFactoryISOTimezone().newIso8601IdxKey(); newKeyIso8601Idx.setRequiredIso8601(Buff.getRequiredIso8601()); // Check unique indexes if (!existingKeyUTZNameIdx.equals(newKeyUTZNameIdx)) { if (dictByUTZNameIdx.containsKey(newKeyUTZNameIdx)) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), "updateISOTimezone", "ISOTimezoneUTZNameIdx", newKeyUTZNameIdx); } } // Validate foreign keys // Update is valid SortedMap<CFAccISOTimezonePKey, CFAccISOTimezoneBuff> subdict; dictByPKey.remove(pkey); dictByPKey.put(pkey, Buff); subdict = dictByOffsetIdx.get(existingKeyOffsetIdx); if (subdict != null) { subdict.remove(pkey); } if (dictByOffsetIdx.containsKey(newKeyOffsetIdx)) { subdict = dictByOffsetIdx.get(newKeyOffsetIdx); } else { subdict = new TreeMap<CFAccISOTimezonePKey, CFAccISOTimezoneBuff>(); dictByOffsetIdx.put(newKeyOffsetIdx, subdict); } subdict.put(pkey, Buff); dictByUTZNameIdx.remove(existingKeyUTZNameIdx); dictByUTZNameIdx.put(newKeyUTZNameIdx, Buff); subdict = dictByIso8601Idx.get(existingKeyIso8601Idx); if (subdict != null) { subdict.remove(pkey); } if (dictByIso8601Idx.containsKey(newKeyIso8601Idx)) { subdict = dictByIso8601Idx.get(newKeyIso8601Idx); } else { subdict = new TreeMap<CFAccISOTimezonePKey, CFAccISOTimezoneBuff>(); dictByIso8601Idx.put(newKeyIso8601Idx, subdict); } subdict.put(pkey, Buff); }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstRam.CFAstRamExtensionsConfTable.java
public void updateExtensionsConf(CFAstAuthorization Authorization, CFAstExtensionsConfBuff Buff) { schema.getTableConfigurationFile().updateConfigurationFile(Authorization, Buff); CFAstConfigurationFilePKey pkey = schema.getFactoryConfigurationFile().newPKey(); pkey.setRequiredClusterId(Buff.getRequiredClusterId()); pkey.setRequiredId(Buff.getRequiredId()); CFAstExtensionsConfBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateExtensionsConf", "Existing record not found", "ExtensionsConf", pkey); }/*from w ww .j a v a2 s . co m*/ CFAstExtensionsConfByExtClusterIdxKey existingKeyExtClusterIdx = schema.getFactoryExtensionsConf() .newExtClusterIdxKey(); existingKeyExtClusterIdx.setRequiredClusterId(existing.getRequiredClusterId()); CFAstExtensionsConfByExtClusterIdxKey newKeyExtClusterIdx = schema.getFactoryExtensionsConf() .newExtClusterIdxKey(); newKeyExtClusterIdx.setRequiredClusterId(Buff.getRequiredClusterId()); // Check unique indexes // Validate foreign keys { boolean allNull = true; if (allNull) { if (null == schema.getTableConfigurationFile().readDerivedByIdIdx(Authorization, Buff.getRequiredClusterId(), Buff.getRequiredId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateExtensionsConf", "Superclass", "SuperClass", "ConfigurationFile", null); } } } // Update is valid SortedMap<CFAstConfigurationFilePKey, CFAstExtensionsConfBuff> subdict; dictByPKey.remove(pkey); dictByPKey.put(pkey, Buff); subdict = dictByExtClusterIdx.get(existingKeyExtClusterIdx); if (subdict != null) { subdict.remove(pkey); } if (dictByExtClusterIdx.containsKey(newKeyExtClusterIdx)) { subdict = dictByExtClusterIdx.get(newKeyExtClusterIdx); } else { subdict = new TreeMap<CFAstConfigurationFilePKey, CFAstExtensionsConfBuff>(); dictByExtClusterIdx.put(newKeyExtClusterIdx, subdict); } subdict.put(pkey, Buff); }