List of usage examples for java.util SortedMap remove
V remove(Object key);
From source file:net.sourceforge.msscodefactory.cfgcash.v2_0.CFGCashRam.CFGCashRamURLProtocolTable.java
public void deleteURLProtocol(CFGCashAuthorization Authorization, CFGCashURLProtocolBuff Buff) { final String S_ProcName = "CFGCashRamURLProtocolTable.deleteURLProtocol() "; CFGCashURLProtocolPKey pkey = schema.getFactoryURLProtocol().newPKey(); pkey.setRequiredURLProtocolId(Buff.getRequiredURLProtocolId()); CFGCashURLProtocolBuff existing = dictByPKey.get(pkey); if (existing == null) { return;/*w ww. j ava 2 s . c o m*/ } if (existing.getRequiredRevision() != Buff.getRequiredRevision()) { throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteURLProtocol", pkey); } CFGCashURLProtocolByUNameIdxKey keyUNameIdx = schema.getFactoryURLProtocol().newUNameIdxKey(); keyUNameIdx.setRequiredName(existing.getRequiredName()); CFGCashURLProtocolByIsSecureIdxKey keyIsSecureIdx = schema.getFactoryURLProtocol().newIsSecureIdxKey(); keyIsSecureIdx.setRequiredIsSecure(existing.getRequiredIsSecure()); // Validate reverse foreign keys // Delete is valid SortedMap<CFGCashURLProtocolPKey, CFGCashURLProtocolBuff> subdict; dictByPKey.remove(pkey); dictByUNameIdx.remove(keyUNameIdx); subdict = dictByIsSecureIdx.get(keyIsSecureIdx); subdict.remove(pkey); }
From source file:net.sourceforge.msscodefactory.cfinternet.v2_0.CFInternetRam.CFInternetRamSecAppTable.java
public void updateSecApp(CFInternetAuthorization Authorization, CFInternetSecAppBuff Buff) { CFInternetSecAppPKey pkey = schema.getFactorySecApp().newPKey(); pkey.setRequiredClusterId(Buff.getRequiredClusterId()); pkey.setRequiredSecAppId(Buff.getRequiredSecAppId()); CFInternetSecAppBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateSecApp", "Existing record not found", "SecApp", pkey); }//from w w w . j a v a 2s. com if (existing.getRequiredRevision() != Buff.getRequiredRevision()) { throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "updateSecApp", pkey); } Buff.setRequiredRevision(Buff.getRequiredRevision() + 1); CFInternetSecAppByClusterIdxKey existingKeyClusterIdx = schema.getFactorySecApp().newClusterIdxKey(); existingKeyClusterIdx.setRequiredClusterId(existing.getRequiredClusterId()); CFInternetSecAppByClusterIdxKey newKeyClusterIdx = schema.getFactorySecApp().newClusterIdxKey(); newKeyClusterIdx.setRequiredClusterId(Buff.getRequiredClusterId()); CFInternetSecAppByUJEEMountIdxKey existingKeyUJEEMountIdx = schema.getFactorySecApp().newUJEEMountIdxKey(); existingKeyUJEEMountIdx.setRequiredClusterId(existing.getRequiredClusterId()); existingKeyUJEEMountIdx.setRequiredJEEMountName(existing.getRequiredJEEMountName()); CFInternetSecAppByUJEEMountIdxKey newKeyUJEEMountIdx = schema.getFactorySecApp().newUJEEMountIdxKey(); newKeyUJEEMountIdx.setRequiredClusterId(Buff.getRequiredClusterId()); newKeyUJEEMountIdx.setRequiredJEEMountName(Buff.getRequiredJEEMountName()); // Check unique indexes if (!existingKeyUJEEMountIdx.equals(newKeyUJEEMountIdx)) { if (dictByUJEEMountIdx.containsKey(newKeyUJEEMountIdx)) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), "updateSecApp", "SecAppUJEEMountIdx", newKeyUJEEMountIdx); } } // Validate foreign keys { boolean allNull = true; if (allNull) { if (null == schema.getTableCluster().readDerivedByIdIdx(Authorization, Buff.getRequiredClusterId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateSecApp", "Container", "SecAppCluster", "Cluster", null); } } } // Update is valid SortedMap<CFInternetSecAppPKey, CFInternetSecAppBuff> subdict; dictByPKey.remove(pkey); dictByPKey.put(pkey, Buff); subdict = dictByClusterIdx.get(existingKeyClusterIdx); if (subdict != null) { subdict.remove(pkey); } if (dictByClusterIdx.containsKey(newKeyClusterIdx)) { subdict = dictByClusterIdx.get(newKeyClusterIdx); } else { subdict = new TreeMap<CFInternetSecAppPKey, CFInternetSecAppBuff>(); dictByClusterIdx.put(newKeyClusterIdx, subdict); } subdict.put(pkey, Buff); dictByUJEEMountIdx.remove(existingKeyUJEEMountIdx); dictByUJEEMountIdx.put(newKeyUJEEMountIdx, Buff); }
From source file:net.sourceforge.msscodefactory.cfinternet.v2_0.CFInternetRam.CFInternetRamSecAppTable.java
public void deleteSecApp(CFInternetAuthorization Authorization, CFInternetSecAppBuff Buff) { final String S_ProcName = "CFInternetRamSecAppTable.deleteSecApp() "; CFInternetSecAppPKey pkey = schema.getFactorySecApp().newPKey(); pkey.setRequiredClusterId(Buff.getRequiredClusterId()); pkey.setRequiredSecAppId(Buff.getRequiredSecAppId()); CFInternetSecAppBuff existing = dictByPKey.get(pkey); if (existing == null) { return;/*from w w w .j a v a 2 s . co m*/ } if (existing.getRequiredRevision() != Buff.getRequiredRevision()) { throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteSecApp", pkey); } CFInternetSecAppByClusterIdxKey keyClusterIdx = schema.getFactorySecApp().newClusterIdxKey(); keyClusterIdx.setRequiredClusterId(existing.getRequiredClusterId()); CFInternetSecAppByUJEEMountIdxKey keyUJEEMountIdx = schema.getFactorySecApp().newUJEEMountIdxKey(); keyUJEEMountIdx.setRequiredClusterId(existing.getRequiredClusterId()); keyUJEEMountIdx.setRequiredJEEMountName(existing.getRequiredJEEMountName()); // Validate reverse foreign keys // Delete is valid schema.getTableSecForm().deleteSecFormBySecAppIdx(Authorization, Buff.getRequiredClusterId(), Buff.getRequiredSecAppId()); SortedMap<CFInternetSecAppPKey, CFInternetSecAppBuff> subdict; dictByPKey.remove(pkey); subdict = dictByClusterIdx.get(keyClusterIdx); subdict.remove(pkey); dictByUJEEMountIdx.remove(keyUJEEMountIdx); }
From source file:net.sourceforge.msscodefactory.cfsecurity.v2_0.CFSecurityRam.CFSecurityRamHostNodeTable.java
public void updateHostNode(CFSecurityAuthorization Authorization, CFSecurityHostNodeBuff Buff) { CFSecurityHostNodePKey pkey = schema.getFactoryHostNode().newPKey(); pkey.setRequiredClusterId(Buff.getRequiredClusterId()); pkey.setRequiredHostNodeId(Buff.getRequiredHostNodeId()); CFSecurityHostNodeBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateHostNode", "Existing record not found", "HostNode", pkey); }// www . j a v a 2s . c o m if (existing.getRequiredRevision() != Buff.getRequiredRevision()) { throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "updateHostNode", pkey); } Buff.setRequiredRevision(Buff.getRequiredRevision() + 1); CFSecurityHostNodeByClusterIdxKey existingKeyClusterIdx = schema.getFactoryHostNode().newClusterIdxKey(); existingKeyClusterIdx.setRequiredClusterId(existing.getRequiredClusterId()); CFSecurityHostNodeByClusterIdxKey newKeyClusterIdx = schema.getFactoryHostNode().newClusterIdxKey(); newKeyClusterIdx.setRequiredClusterId(Buff.getRequiredClusterId()); CFSecurityHostNodeByUDescrIdxKey existingKeyUDescrIdx = schema.getFactoryHostNode().newUDescrIdxKey(); existingKeyUDescrIdx.setRequiredClusterId(existing.getRequiredClusterId()); existingKeyUDescrIdx.setRequiredDescription(existing.getRequiredDescription()); CFSecurityHostNodeByUDescrIdxKey newKeyUDescrIdx = schema.getFactoryHostNode().newUDescrIdxKey(); newKeyUDescrIdx.setRequiredClusterId(Buff.getRequiredClusterId()); newKeyUDescrIdx.setRequiredDescription(Buff.getRequiredDescription()); CFSecurityHostNodeByHostNameIdxKey existingKeyHostNameIdx = schema.getFactoryHostNode().newHostNameIdxKey(); existingKeyHostNameIdx.setRequiredClusterId(existing.getRequiredClusterId()); existingKeyHostNameIdx.setRequiredHostName(existing.getRequiredHostName()); CFSecurityHostNodeByHostNameIdxKey newKeyHostNameIdx = schema.getFactoryHostNode().newHostNameIdxKey(); newKeyHostNameIdx.setRequiredClusterId(Buff.getRequiredClusterId()); newKeyHostNameIdx.setRequiredHostName(Buff.getRequiredHostName()); // Check unique indexes if (!existingKeyUDescrIdx.equals(newKeyUDescrIdx)) { if (dictByUDescrIdx.containsKey(newKeyUDescrIdx)) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), "updateHostNode", "HostNodeUDescrIdx", newKeyUDescrIdx); } } if (!existingKeyHostNameIdx.equals(newKeyHostNameIdx)) { if (dictByHostNameIdx.containsKey(newKeyHostNameIdx)) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), "updateHostNode", "HostNodeUHostNameIdx", newKeyHostNameIdx); } } // Validate foreign keys { boolean allNull = true; if (allNull) { if (null == schema.getTableCluster().readDerivedByIdIdx(Authorization, Buff.getRequiredClusterId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateHostNode", "Container", "HostNodeCluster", "Cluster", null); } } } // Update is valid SortedMap<CFSecurityHostNodePKey, CFSecurityHostNodeBuff> subdict; dictByPKey.remove(pkey); dictByPKey.put(pkey, Buff); subdict = dictByClusterIdx.get(existingKeyClusterIdx); if (subdict != null) { subdict.remove(pkey); } if (dictByClusterIdx.containsKey(newKeyClusterIdx)) { subdict = dictByClusterIdx.get(newKeyClusterIdx); } else { subdict = new TreeMap<CFSecurityHostNodePKey, CFSecurityHostNodeBuff>(); dictByClusterIdx.put(newKeyClusterIdx, subdict); } subdict.put(pkey, Buff); dictByUDescrIdx.remove(existingKeyUDescrIdx); dictByUDescrIdx.put(newKeyUDescrIdx, Buff); dictByHostNameIdx.remove(existingKeyHostNameIdx); dictByHostNameIdx.put(newKeyHostNameIdx, Buff); }
From source file:net.sourceforge.msscodefactory.cfsecurity.v2_0.CFSecurityRam.CFSecurityRamHostNodeTable.java
public void deleteHostNode(CFSecurityAuthorization Authorization, CFSecurityHostNodeBuff Buff) { final String S_ProcName = "CFSecurityRamHostNodeTable.deleteHostNode() "; CFSecurityHostNodePKey pkey = schema.getFactoryHostNode().newPKey(); pkey.setRequiredClusterId(Buff.getRequiredClusterId()); pkey.setRequiredHostNodeId(Buff.getRequiredHostNodeId()); CFSecurityHostNodeBuff existing = dictByPKey.get(pkey); if (existing == null) { return;// w ww . ja v a2 s. c o m } if (existing.getRequiredRevision() != Buff.getRequiredRevision()) { throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteHostNode", pkey); } CFSecurityHostNodeByClusterIdxKey keyClusterIdx = schema.getFactoryHostNode().newClusterIdxKey(); keyClusterIdx.setRequiredClusterId(existing.getRequiredClusterId()); CFSecurityHostNodeByUDescrIdxKey keyUDescrIdx = schema.getFactoryHostNode().newUDescrIdxKey(); keyUDescrIdx.setRequiredClusterId(existing.getRequiredClusterId()); keyUDescrIdx.setRequiredDescription(existing.getRequiredDescription()); CFSecurityHostNodeByHostNameIdxKey keyHostNameIdx = schema.getFactoryHostNode().newHostNameIdxKey(); keyHostNameIdx.setRequiredClusterId(existing.getRequiredClusterId()); keyHostNameIdx.setRequiredHostName(existing.getRequiredHostName()); // Validate reverse foreign keys // Delete is valid schema.getTableService().deleteServiceByHostIdx(Authorization, Buff.getRequiredClusterId(), Buff.getRequiredHostNodeId()); SortedMap<CFSecurityHostNodePKey, CFSecurityHostNodeBuff> subdict; dictByPKey.remove(pkey); subdict = dictByClusterIdx.get(keyClusterIdx); subdict.remove(pkey); dictByUDescrIdx.remove(keyUDescrIdx); dictByHostNameIdx.remove(keyHostNameIdx); }
From source file:net.sourceforge.msscodefactory.cfsecurity.v2_0.CFSecurityRam.CFSecurityRamISOCountryCurrencyTable.java
public void updateISOCountryCurrency(CFSecurityAuthorization Authorization, CFSecurityISOCountryCurrencyBuff Buff) { CFSecurityISOCountryCurrencyPKey pkey = schema.getFactoryISOCountryCurrency().newPKey(); pkey.setRequiredISOCountryId(Buff.getRequiredISOCountryId()); pkey.setRequiredISOCurrencyId(Buff.getRequiredISOCurrencyId()); CFSecurityISOCountryCurrencyBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateISOCountryCurrency", "Existing record not found", "ISOCountryCurrency", pkey); }//from ww w .j av a 2 s .c om if (existing.getRequiredRevision() != Buff.getRequiredRevision()) { throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "updateISOCountryCurrency", pkey); } Buff.setRequiredRevision(Buff.getRequiredRevision() + 1); CFSecurityISOCountryCurrencyByCountryIdxKey existingKeyCountryIdx = schema.getFactoryISOCountryCurrency() .newCountryIdxKey(); existingKeyCountryIdx.setRequiredISOCountryId(existing.getRequiredISOCountryId()); CFSecurityISOCountryCurrencyByCountryIdxKey newKeyCountryIdx = schema.getFactoryISOCountryCurrency() .newCountryIdxKey(); newKeyCountryIdx.setRequiredISOCountryId(Buff.getRequiredISOCountryId()); CFSecurityISOCountryCurrencyByCurrencyIdxKey existingKeyCurrencyIdx = schema.getFactoryISOCountryCurrency() .newCurrencyIdxKey(); existingKeyCurrencyIdx.setRequiredISOCurrencyId(existing.getRequiredISOCurrencyId()); CFSecurityISOCountryCurrencyByCurrencyIdxKey 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<CFSecurityISOCountryCurrencyPKey, CFSecurityISOCountryCurrencyBuff> 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<CFSecurityISOCountryCurrencyPKey, CFSecurityISOCountryCurrencyBuff>(); 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<CFSecurityISOCountryCurrencyPKey, CFSecurityISOCountryCurrencyBuff>(); dictByCurrencyIdx.put(newKeyCurrencyIdx, subdict); } subdict.put(pkey, Buff); }
From source file:net.sourceforge.msscodefactory.cfsecurity.v2_0.CFSecurityRam.CFSecurityRamISOCountryCurrencyTable.java
public void deleteISOCountryCurrency(CFSecurityAuthorization Authorization, CFSecurityISOCountryCurrencyBuff Buff) { final String S_ProcName = "CFSecurityRamISOCountryCurrencyTable.deleteISOCountryCurrency() "; CFSecurityISOCountryCurrencyPKey pkey = schema.getFactoryISOCountryCurrency().newPKey(); pkey.setRequiredISOCountryId(Buff.getRequiredISOCountryId()); pkey.setRequiredISOCurrencyId(Buff.getRequiredISOCurrencyId()); CFSecurityISOCountryCurrencyBuff existing = dictByPKey.get(pkey); if (existing == null) { return;/*from ww w.java2 s . c o m*/ } if (existing.getRequiredRevision() != Buff.getRequiredRevision()) { throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteISOCountryCurrency", pkey); } CFSecurityISOCountryCurrencyByCountryIdxKey keyCountryIdx = schema.getFactoryISOCountryCurrency() .newCountryIdxKey(); keyCountryIdx.setRequiredISOCountryId(existing.getRequiredISOCountryId()); CFSecurityISOCountryCurrencyByCurrencyIdxKey keyCurrencyIdx = schema.getFactoryISOCountryCurrency() .newCurrencyIdxKey(); keyCurrencyIdx.setRequiredISOCurrencyId(existing.getRequiredISOCurrencyId()); // Validate reverse foreign keys // Delete is valid SortedMap<CFSecurityISOCountryCurrencyPKey, CFSecurityISOCountryCurrencyBuff> subdict; dictByPKey.remove(pkey); subdict = dictByCountryIdx.get(keyCountryIdx); subdict.remove(pkey); subdict = dictByCurrencyIdx.get(keyCurrencyIdx); subdict.remove(pkey); }
From source file:net.sourceforge.msscodefactory.cfsecurity.v2_0.CFSecurityRam.CFSecurityRamISOCountryLanguageTable.java
public void updateISOCountryLanguage(CFSecurityAuthorization Authorization, CFSecurityISOCountryLanguageBuff Buff) { CFSecurityISOCountryLanguagePKey pkey = schema.getFactoryISOCountryLanguage().newPKey(); pkey.setRequiredISOCountryId(Buff.getRequiredISOCountryId()); pkey.setRequiredISOLanguageId(Buff.getRequiredISOLanguageId()); CFSecurityISOCountryLanguageBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateISOCountryLanguage", "Existing record not found", "ISOCountryLanguage", pkey); }//from w w w . j a va 2 s . co m if (existing.getRequiredRevision() != Buff.getRequiredRevision()) { throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "updateISOCountryLanguage", pkey); } Buff.setRequiredRevision(Buff.getRequiredRevision() + 1); CFSecurityISOCountryLanguageByCountryIdxKey existingKeyCountryIdx = schema.getFactoryISOCountryLanguage() .newCountryIdxKey(); existingKeyCountryIdx.setRequiredISOCountryId(existing.getRequiredISOCountryId()); CFSecurityISOCountryLanguageByCountryIdxKey newKeyCountryIdx = schema.getFactoryISOCountryLanguage() .newCountryIdxKey(); newKeyCountryIdx.setRequiredISOCountryId(Buff.getRequiredISOCountryId()); CFSecurityISOCountryLanguageByLanguageIdxKey existingKeyLanguageIdx = schema.getFactoryISOCountryLanguage() .newLanguageIdxKey(); existingKeyLanguageIdx.setRequiredISOLanguageId(existing.getRequiredISOLanguageId()); CFSecurityISOCountryLanguageByLanguageIdxKey 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<CFSecurityISOCountryLanguagePKey, CFSecurityISOCountryLanguageBuff> 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<CFSecurityISOCountryLanguagePKey, CFSecurityISOCountryLanguageBuff>(); 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<CFSecurityISOCountryLanguagePKey, CFSecurityISOCountryLanguageBuff>(); dictByLanguageIdx.put(newKeyLanguageIdx, subdict); } subdict.put(pkey, Buff); }
From source file:net.sourceforge.msscodefactory.cfsecurity.v2_0.CFSecurityRam.CFSecurityRamISOCountryLanguageTable.java
public void deleteISOCountryLanguage(CFSecurityAuthorization Authorization, CFSecurityISOCountryLanguageBuff Buff) { final String S_ProcName = "CFSecurityRamISOCountryLanguageTable.deleteISOCountryLanguage() "; CFSecurityISOCountryLanguagePKey pkey = schema.getFactoryISOCountryLanguage().newPKey(); pkey.setRequiredISOCountryId(Buff.getRequiredISOCountryId()); pkey.setRequiredISOLanguageId(Buff.getRequiredISOLanguageId()); CFSecurityISOCountryLanguageBuff existing = dictByPKey.get(pkey); if (existing == null) { return;/* w ww. j a v a 2 s.co m*/ } if (existing.getRequiredRevision() != Buff.getRequiredRevision()) { throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteISOCountryLanguage", pkey); } CFSecurityISOCountryLanguageByCountryIdxKey keyCountryIdx = schema.getFactoryISOCountryLanguage() .newCountryIdxKey(); keyCountryIdx.setRequiredISOCountryId(existing.getRequiredISOCountryId()); CFSecurityISOCountryLanguageByLanguageIdxKey keyLanguageIdx = schema.getFactoryISOCountryLanguage() .newLanguageIdxKey(); keyLanguageIdx.setRequiredISOLanguageId(existing.getRequiredISOLanguageId()); // Validate reverse foreign keys // Delete is valid SortedMap<CFSecurityISOCountryLanguagePKey, CFSecurityISOCountryLanguageBuff> subdict; dictByPKey.remove(pkey); subdict = dictByCountryIdx.get(keyCountryIdx); subdict.remove(pkey); subdict = dictByLanguageIdx.get(keyLanguageIdx); subdict.remove(pkey); }
From source file:net.sourceforge.msscodefactory.cfsecurity.v2_0.CFSecurityRam.CFSecurityRamISOLanguageTable.java
public void updateISOLanguage(CFSecurityAuthorization Authorization, CFSecurityISOLanguageBuff Buff) { CFSecurityISOLanguagePKey pkey = schema.getFactoryISOLanguage().newPKey(); pkey.setRequiredId(Buff.getRequiredId()); CFSecurityISOLanguageBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateISOLanguage", "Existing record not found", "ISOLanguage", pkey); }//from w w w .jav a 2s .c o m if (existing.getRequiredRevision() != Buff.getRequiredRevision()) { throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "updateISOLanguage", pkey); } Buff.setRequiredRevision(Buff.getRequiredRevision() + 1); CFSecurityISOLanguageByBaseIdxKey existingKeyBaseIdx = schema.getFactoryISOLanguage().newBaseIdxKey(); existingKeyBaseIdx.setRequiredBaseLanguageCode(existing.getRequiredBaseLanguageCode()); CFSecurityISOLanguageByBaseIdxKey newKeyBaseIdx = schema.getFactoryISOLanguage().newBaseIdxKey(); newKeyBaseIdx.setRequiredBaseLanguageCode(Buff.getRequiredBaseLanguageCode()); CFSecurityISOLanguageByCountryIdxKey existingKeyCountryIdx = schema.getFactoryISOLanguage() .newCountryIdxKey(); existingKeyCountryIdx.setOptionalISOCountryId(existing.getOptionalISOCountryId()); CFSecurityISOLanguageByCountryIdxKey newKeyCountryIdx = schema.getFactoryISOLanguage().newCountryIdxKey(); newKeyCountryIdx.setOptionalISOCountryId(Buff.getOptionalISOCountryId()); CFSecurityISOLanguageByCodeIdxKey existingKeyCodeIdx = schema.getFactoryISOLanguage().newCodeIdxKey(); existingKeyCodeIdx.setRequiredISOCode(existing.getRequiredISOCode()); CFSecurityISOLanguageByCodeIdxKey newKeyCodeIdx = schema.getFactoryISOLanguage().newCodeIdxKey(); newKeyCodeIdx.setRequiredISOCode(Buff.getRequiredISOCode()); // Check unique indexes if (!existingKeyCodeIdx.equals(newKeyCodeIdx)) { if (dictByCodeIdx.containsKey(newKeyCodeIdx)) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), "updateISOLanguage", "ISOLanguageCodeIdx", newKeyCodeIdx); } } // Validate foreign keys // Update is valid SortedMap<CFSecurityISOLanguagePKey, CFSecurityISOLanguageBuff> subdict; dictByPKey.remove(pkey); dictByPKey.put(pkey, Buff); subdict = dictByBaseIdx.get(existingKeyBaseIdx); if (subdict != null) { subdict.remove(pkey); } if (dictByBaseIdx.containsKey(newKeyBaseIdx)) { subdict = dictByBaseIdx.get(newKeyBaseIdx); } else { subdict = new TreeMap<CFSecurityISOLanguagePKey, CFSecurityISOLanguageBuff>(); dictByBaseIdx.put(newKeyBaseIdx, subdict); } subdict.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<CFSecurityISOLanguagePKey, CFSecurityISOLanguageBuff>(); dictByCountryIdx.put(newKeyCountryIdx, subdict); } subdict.put(pkey, Buff); dictByCodeIdx.remove(existingKeyCodeIdx); dictByCodeIdx.put(newKeyCodeIdx, Buff); }