List of usage examples for java.util SortedMap remove
V remove(Object key);
From source file:net.sourceforge.msscodefactory.v1_11.MSSBamRam.MSSBamRamDelSubDep2Table.java
public void deleteDelSubDep2(MSSBamAuthorization Authorization, MSSBamDelSubDep2Buff Buff) { final String S_ProcName = "MSSBamRamDelSubDep2Table.deleteDelSubDep2() "; MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey(); pkey.setRequiredId(schema.nextAnyObjIdGen()); MSSBamDelSubDep2Buff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "deleteDelSubDep2", "Existing record not found", "DelSubDep2", pkey); }/*from ww w . java 2 s . co m*/ if (existing.getRequiredRevision() != Buff.getRequiredRevision()) { throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteDelSubDep2", pkey); } MSSBamDelSubDep2ByContDelDep1IdxKey keyContDelDep1Idx = schema.getFactoryDelSubDep2() .newContDelDep1IdxKey(); keyContDelDep1Idx.setRequiredContDelDep1Id(existing.getRequiredContDelDep1Id()); // Validate reverse foreign keys if (schema.getTableDelSubDep3().readDerivedByContDelDep2Idx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteDelSubDep2", "Container", "ContDelSubDep3", "DelSubDep3", pkey); } // Delete is valid SortedMap<MSSBamAnyObjPKey, MSSBamDelSubDep2Buff> subdict; dictByPKey.remove(pkey); subdict = dictByContDelDep1Idx.get(keyContDelDep1Idx); subdict.remove(pkey); }
From source file:net.sourceforge.msscodefactory.v1_11.MSSBamRam.MSSBamRamDelSubDep3Table.java
public void updateDelSubDep3(MSSBamAuthorization Authorization, MSSBamDelSubDep3Buff Buff) { MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey(); pkey.setRequiredId(Buff.getRequiredId()); MSSBamDelSubDep3Buff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateDelSubDep3", "Existing record not found", "DelSubDep3", pkey); }//w w w . ja v a 2 s . com MSSBamDelSubDep3ByContDelDep2IdxKey existingKeyContDelDep2Idx = schema.getFactoryDelSubDep3() .newContDelDep2IdxKey(); existingKeyContDelDep2Idx.setRequiredContDelDep2Id(existing.getRequiredContDelDep2Id()); MSSBamDelSubDep3ByContDelDep2IdxKey newKeyContDelDep2Idx = schema.getFactoryDelSubDep3() .newContDelDep2IdxKey(); newKeyContDelDep2Idx.setRequiredContDelDep2Id(Buff.getRequiredContDelDep2Id()); // Check unique indexes // Validate foreign keys { boolean allNull = true; if (allNull) { if (null == schema.getTableDelDep().readDerivedByIdIdx(Authorization, Buff.getRequiredId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateDelSubDep3", "Superclass", "SuperClass", "DelDep", null); } } } { boolean allNull = true; if (allNull) { if (null == schema.getTableDelSubDep2().readDerivedByIdIdx(Authorization, Buff.getRequiredContDelDep2Id())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateDelSubDep3", "Container", "ContDelSubDep3", "DelSubDep2", null); } } } // Update is valid SortedMap<MSSBamAnyObjPKey, MSSBamDelSubDep3Buff> subdict; dictByPKey.remove(pkey); dictByPKey.put(pkey, Buff); subdict = dictByContDelDep2Idx.get(existingKeyContDelDep2Idx); if (subdict != null) { subdict.remove(pkey); } if (dictByContDelDep2Idx.containsKey(newKeyContDelDep2Idx)) { subdict = dictByContDelDep2Idx.get(newKeyContDelDep2Idx); } else { subdict = new TreeMap<MSSBamAnyObjPKey, MSSBamDelSubDep3Buff>(); dictByContDelDep2Idx.put(newKeyContDelDep2Idx, subdict); } subdict.put(pkey, Buff); }
From source file:net.sourceforge.msscodefactory.v1_11.MSSBamRam.MSSBamRamDelSubDep3Table.java
public void deleteDelSubDep3(MSSBamAuthorization Authorization, MSSBamDelSubDep3Buff Buff) { final String S_ProcName = "MSSBamRamDelSubDep3Table.deleteDelSubDep3() "; MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey(); pkey.setRequiredId(schema.nextAnyObjIdGen()); MSSBamDelSubDep3Buff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "deleteDelSubDep3", "Existing record not found", "DelSubDep3", pkey); }//w w w .j a va 2 s . c om if (existing.getRequiredRevision() != Buff.getRequiredRevision()) { throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteDelSubDep3", pkey); } MSSBamDelSubDep3ByContDelDep2IdxKey keyContDelDep2Idx = schema.getFactoryDelSubDep3() .newContDelDep2IdxKey(); keyContDelDep2Idx.setRequiredContDelDep2Id(existing.getRequiredContDelDep2Id()); // Validate reverse foreign keys // Delete is valid SortedMap<MSSBamAnyObjPKey, MSSBamDelSubDep3Buff> subdict; dictByPKey.remove(pkey); subdict = dictByContDelDep2Idx.get(keyContDelDep2Idx); subdict.remove(pkey); }
From source file:net.sourceforge.msscodefactory.v1_11.MSSBamRam.MSSBamRamDelTopDepTable.java
public void updateDelTopDep(MSSBamAuthorization Authorization, MSSBamDelTopDepBuff Buff) { MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey(); pkey.setRequiredId(Buff.getRequiredId()); MSSBamDelTopDepBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateDelTopDep", "Existing record not found", "DelTopDep", pkey); }/*from ww w . j a v a 2 s . co m*/ MSSBamDelTopDepByContTblIdxKey existingKeyContTblIdx = schema.getFactoryDelTopDep().newContTblIdxKey(); existingKeyContTblIdx.setRequiredContTableId(existing.getRequiredContTableId()); MSSBamDelTopDepByContTblIdxKey newKeyContTblIdx = schema.getFactoryDelTopDep().newContTblIdxKey(); newKeyContTblIdx.setRequiredContTableId(Buff.getRequiredContTableId()); // Check unique indexes // Validate foreign keys { boolean allNull = true; if (allNull) { if (null == schema.getTableDelDep().readDerivedByIdIdx(Authorization, Buff.getRequiredId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateDelTopDep", "Superclass", "SuperClass", "DelDep", null); } } } { boolean allNull = true; if (allNull) { if (null == schema.getTableTable().readDerivedByIdIdx(Authorization, Buff.getRequiredContTableId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateDelTopDep", "Container", "ContTable", "Table", null); } } } // Update is valid SortedMap<MSSBamAnyObjPKey, MSSBamDelTopDepBuff> subdict; dictByPKey.remove(pkey); dictByPKey.put(pkey, Buff); subdict = dictByContTblIdx.get(existingKeyContTblIdx); if (subdict != null) { subdict.remove(pkey); } if (dictByContTblIdx.containsKey(newKeyContTblIdx)) { subdict = dictByContTblIdx.get(newKeyContTblIdx); } else { subdict = new TreeMap<MSSBamAnyObjPKey, MSSBamDelTopDepBuff>(); dictByContTblIdx.put(newKeyContTblIdx, subdict); } subdict.put(pkey, Buff); }
From source file:net.sourceforge.msscodefactory.v1_11.MSSBamRam.MSSBamRamDelTopDepTable.java
public void deleteDelTopDep(MSSBamAuthorization Authorization, MSSBamDelTopDepBuff Buff) { final String S_ProcName = "MSSBamRamDelTopDepTable.deleteDelTopDep() "; MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey(); pkey.setRequiredId(schema.nextAnyObjIdGen()); MSSBamDelTopDepBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "deleteDelTopDep", "Existing record not found", "DelTopDep", pkey); }//from ww w. j ava 2s . co m if (existing.getRequiredRevision() != Buff.getRequiredRevision()) { throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteDelTopDep", pkey); } MSSBamDelTopDepByContTblIdxKey keyContTblIdx = schema.getFactoryDelTopDep().newContTblIdxKey(); keyContTblIdx.setRequiredContTableId(existing.getRequiredContTableId()); // Validate reverse foreign keys if (schema.getTableDelSubDep1().readDerivedByContDelTopIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteDelTopDep", "Container", "ContDelTopDep", "DelSubDep1", pkey); } // Delete is valid SortedMap<MSSBamAnyObjPKey, MSSBamDelTopDepBuff> subdict; dictByPKey.remove(pkey); subdict = dictByContTblIdx.get(keyContTblIdx); subdict.remove(pkey); }
From source file:net.sourceforge.msscodefactory.v1_11.MSSBamRam.MSSBamRamGroupOperatorTable.java
public void updateGroupOperator(MSSBamAuthorization Authorization, MSSBamGroupOperatorBuff Buff) { MSSBamGroupOperatorPKey pkey = schema.getFactoryGroupOperator().newPKey(); pkey.setRequiredId(Buff.getRequiredId()); MSSBamGroupOperatorBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateGroupOperator", "Existing record not found", "GroupOperator", pkey); }//from w w w . j a v a 2 s. com if (existing.getRequiredRevision() != Buff.getRequiredRevision()) { throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "updateGroupOperator", pkey); } Buff.setRequiredRevision(Buff.getRequiredRevision() + 1); MSSBamGroupOperatorByUNameIdxKey existingKeyUNameIdx = schema.getFactoryGroupOperator().newUNameIdxKey(); existingKeyUNameIdx.setRequiredName(existing.getRequiredName()); MSSBamGroupOperatorByUNameIdxKey newKeyUNameIdx = schema.getFactoryGroupOperator().newUNameIdxKey(); newKeyUNameIdx.setRequiredName(Buff.getRequiredName()); MSSBamGroupOperatorByApplOptIdxKey existingKeyApplOptIdx = schema.getFactoryGroupOperator() .newApplOptIdxKey(); existingKeyApplOptIdx.setRequiredAppliesToOptional(existing.getRequiredAppliesToOptional()); MSSBamGroupOperatorByApplOptIdxKey newKeyApplOptIdx = schema.getFactoryGroupOperator().newApplOptIdxKey(); newKeyApplOptIdx.setRequiredAppliesToOptional(Buff.getRequiredAppliesToOptional()); MSSBamGroupOperatorByApplStrIdxKey existingKeyApplStrIdx = schema.getFactoryGroupOperator() .newApplStrIdxKey(); existingKeyApplStrIdx.setRequiredAppliesToString(existing.getRequiredAppliesToString()); MSSBamGroupOperatorByApplStrIdxKey newKeyApplStrIdx = schema.getFactoryGroupOperator().newApplStrIdxKey(); newKeyApplStrIdx.setRequiredAppliesToString(Buff.getRequiredAppliesToString()); MSSBamGroupOperatorByApplNumIdxKey existingKeyApplNumIdx = schema.getFactoryGroupOperator() .newApplNumIdxKey(); existingKeyApplNumIdx.setRequiredAppliesToNumeric(existing.getRequiredAppliesToNumeric()); MSSBamGroupOperatorByApplNumIdxKey newKeyApplNumIdx = schema.getFactoryGroupOperator().newApplNumIdxKey(); newKeyApplNumIdx.setRequiredAppliesToNumeric(Buff.getRequiredAppliesToNumeric()); // Check unique indexes if (!existingKeyUNameIdx.equals(newKeyUNameIdx)) { if (dictByUNameIdx.containsKey(newKeyUNameIdx)) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), "updateGroupOperator", "GroupOperatorUNameIdx", newKeyUNameIdx); } } // Validate foreign keys // Update is valid SortedMap<MSSBamGroupOperatorPKey, MSSBamGroupOperatorBuff> subdict; dictByPKey.remove(pkey); dictByPKey.put(pkey, Buff); dictByUNameIdx.remove(existingKeyUNameIdx); dictByUNameIdx.put(newKeyUNameIdx, Buff); subdict = dictByApplOptIdx.get(existingKeyApplOptIdx); if (subdict != null) { subdict.remove(pkey); } if (dictByApplOptIdx.containsKey(newKeyApplOptIdx)) { subdict = dictByApplOptIdx.get(newKeyApplOptIdx); } else { subdict = new TreeMap<MSSBamGroupOperatorPKey, MSSBamGroupOperatorBuff>(); dictByApplOptIdx.put(newKeyApplOptIdx, subdict); } subdict.put(pkey, Buff); subdict = dictByApplStrIdx.get(existingKeyApplStrIdx); if (subdict != null) { subdict.remove(pkey); } if (dictByApplStrIdx.containsKey(newKeyApplStrIdx)) { subdict = dictByApplStrIdx.get(newKeyApplStrIdx); } else { subdict = new TreeMap<MSSBamGroupOperatorPKey, MSSBamGroupOperatorBuff>(); dictByApplStrIdx.put(newKeyApplStrIdx, subdict); } subdict.put(pkey, Buff); subdict = dictByApplNumIdx.get(existingKeyApplNumIdx); if (subdict != null) { subdict.remove(pkey); } if (dictByApplNumIdx.containsKey(newKeyApplNumIdx)) { subdict = dictByApplNumIdx.get(newKeyApplNumIdx); } else { subdict = new TreeMap<MSSBamGroupOperatorPKey, MSSBamGroupOperatorBuff>(); dictByApplNumIdx.put(newKeyApplNumIdx, subdict); } subdict.put(pkey, Buff); }
From source file:net.sourceforge.msscodefactory.v1_11.MSSBamRam.MSSBamRamGroupOperatorTable.java
public void deleteGroupOperator(MSSBamAuthorization Authorization, MSSBamGroupOperatorBuff Buff) { final String S_ProcName = "MSSBamRamGroupOperatorTable.deleteGroupOperator() "; MSSBamGroupOperatorPKey pkey = schema.getFactoryGroupOperator().newPKey(); pkey.setRequiredId(Buff.getRequiredId()); MSSBamGroupOperatorBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "deleteGroupOperator", "Existing record not found", "GroupOperator", pkey); }/*ww w . j a va 2 s. c om*/ if (existing.getRequiredRevision() != Buff.getRequiredRevision()) { throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteGroupOperator", pkey); } MSSBamGroupOperatorByUNameIdxKey keyUNameIdx = schema.getFactoryGroupOperator().newUNameIdxKey(); keyUNameIdx.setRequiredName(existing.getRequiredName()); MSSBamGroupOperatorByApplOptIdxKey keyApplOptIdx = schema.getFactoryGroupOperator().newApplOptIdxKey(); keyApplOptIdx.setRequiredAppliesToOptional(existing.getRequiredAppliesToOptional()); MSSBamGroupOperatorByApplStrIdxKey keyApplStrIdx = schema.getFactoryGroupOperator().newApplStrIdxKey(); keyApplStrIdx.setRequiredAppliesToString(existing.getRequiredAppliesToString()); MSSBamGroupOperatorByApplNumIdxKey keyApplNumIdx = schema.getFactoryGroupOperator().newApplNumIdxKey(); keyApplNumIdx.setRequiredAppliesToNumeric(existing.getRequiredAppliesToNumeric()); // Validate reverse foreign keys if (schema.getTableRelGroupValue().readDerivedByGrpOpIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteGroupOperator", "Lookup", "LookupGroupOperator", "RelGroupValue", pkey); } // Delete is valid SortedMap<MSSBamGroupOperatorPKey, MSSBamGroupOperatorBuff> subdict; dictByPKey.remove(pkey); dictByUNameIdx.remove(keyUNameIdx); subdict = dictByApplOptIdx.get(keyApplOptIdx); subdict.remove(pkey); subdict = dictByApplStrIdx.get(keyApplStrIdx); subdict.remove(pkey); subdict = dictByApplNumIdx.get(keyApplNumIdx); subdict.remove(pkey); }
From source file:net.sourceforge.msscodefactory.v1_11.MSSBamRam.MSSBamRamISOCountryTable.java
public void updateISOCountry(MSSBamAuthorization Authorization, MSSBamISOCountryBuff Buff) { MSSBamISOCountryPKey pkey = schema.getFactoryISOCountry().newPKey(); pkey.setRequiredId(Buff.getRequiredId()); MSSBamISOCountryBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateISOCountry", "Existing record not found", "ISOCountry", pkey); }//from w w w. java2 s.c o m if (existing.getRequiredRevision() != Buff.getRequiredRevision()) { throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "updateISOCountry", pkey); } Buff.setRequiredRevision(Buff.getRequiredRevision() + 1); MSSBamISOCountryByISOCodeIdxKey existingKeyISOCodeIdx = schema.getFactoryISOCountry().newISOCodeIdxKey(); existingKeyISOCodeIdx.setRequiredISOCode(existing.getRequiredISOCode()); MSSBamISOCountryByISOCodeIdxKey newKeyISOCodeIdx = schema.getFactoryISOCountry().newISOCodeIdxKey(); newKeyISOCodeIdx.setRequiredISOCode(Buff.getRequiredISOCode()); MSSBamISOCountryByISOCode3IdxKey existingKeyISOCode3Idx = schema.getFactoryISOCountry().newISOCode3IdxKey(); existingKeyISOCode3Idx.setRequiredISOCode3(existing.getRequiredISOCode3()); MSSBamISOCountryByISOCode3IdxKey newKeyISOCode3Idx = schema.getFactoryISOCountry().newISOCode3IdxKey(); newKeyISOCode3Idx.setRequiredISOCode3(Buff.getRequiredISOCode3()); MSSBamISOCountryByIANACodeIdxKey existingKeyIANACodeIdx = schema.getFactoryISOCountry().newIANACodeIdxKey(); existingKeyIANACodeIdx.setOptionalIANACode(existing.getOptionalIANACode()); MSSBamISOCountryByIANACodeIdxKey newKeyIANACodeIdx = schema.getFactoryISOCountry().newIANACodeIdxKey(); newKeyIANACodeIdx.setOptionalIANACode(Buff.getOptionalIANACode()); MSSBamISOCountryByIOCCodeIdxKey existingKeyIOCCodeIdx = schema.getFactoryISOCountry().newIOCCodeIdxKey(); existingKeyIOCCodeIdx.setOptionalIOCCode(existing.getOptionalIOCCode()); MSSBamISOCountryByIOCCodeIdxKey newKeyIOCCodeIdx = schema.getFactoryISOCountry().newIOCCodeIdxKey(); newKeyIOCCodeIdx.setOptionalIOCCode(Buff.getOptionalIOCCode()); MSSBamISOCountryByUNVCodeIdxKey existingKeyUNVCodeIdx = schema.getFactoryISOCountry().newUNVCodeIdxKey(); existingKeyUNVCodeIdx.setOptionalUNVCode(existing.getOptionalUNVCode()); MSSBamISOCountryByUNVCodeIdxKey newKeyUNVCodeIdx = schema.getFactoryISOCountry().newUNVCodeIdxKey(); newKeyUNVCodeIdx.setOptionalUNVCode(Buff.getOptionalUNVCode()); MSSBamISOCountryByUNISOCodeIdxKey existingKeyUNISOCodeIdx = schema.getFactoryISOCountry() .newUNISOCodeIdxKey(); existingKeyUNISOCodeIdx.setOptionalUNISOCode(existing.getOptionalUNISOCode()); MSSBamISOCountryByUNISOCodeIdxKey newKeyUNISOCodeIdx = schema.getFactoryISOCountry().newUNISOCodeIdxKey(); newKeyUNISOCodeIdx.setOptionalUNISOCode(Buff.getOptionalUNISOCode()); MSSBamISOCountryByITUCallPrefixIdxKey existingKeyITUCallPrefixIdx = schema.getFactoryISOCountry() .newITUCallPrefixIdxKey(); existingKeyITUCallPrefixIdx.setOptionalITUCallPrefix(existing.getOptionalITUCallPrefix()); MSSBamISOCountryByITUCallPrefixIdxKey newKeyITUCallPrefixIdx = schema.getFactoryISOCountry() .newITUCallPrefixIdxKey(); newKeyITUCallPrefixIdx.setOptionalITUCallPrefix(Buff.getOptionalITUCallPrefix()); // Check unique indexes if (!existingKeyISOCodeIdx.equals(newKeyISOCodeIdx)) { if (dictByISOCodeIdx.containsKey(newKeyISOCodeIdx)) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), "updateISOCountry", "ISOCountryCodeIdx", newKeyISOCodeIdx); } } if (!existingKeyISOCode3Idx.equals(newKeyISOCode3Idx)) { if (dictByISOCode3Idx.containsKey(newKeyISOCode3Idx)) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), "updateISOCountry", "ISOCountryCode3Idx", newKeyISOCode3Idx); } } // Validate foreign keys // Update is valid SortedMap<MSSBamISOCountryPKey, MSSBamISOCountryBuff> subdict; dictByPKey.remove(pkey); dictByPKey.put(pkey, Buff); dictByISOCodeIdx.remove(existingKeyISOCodeIdx); dictByISOCodeIdx.put(newKeyISOCodeIdx, Buff); dictByISOCode3Idx.remove(existingKeyISOCode3Idx); dictByISOCode3Idx.put(newKeyISOCode3Idx, Buff); subdict = dictByIANACodeIdx.get(existingKeyIANACodeIdx); if (subdict != null) { subdict.remove(pkey); } if (dictByIANACodeIdx.containsKey(newKeyIANACodeIdx)) { subdict = dictByIANACodeIdx.get(newKeyIANACodeIdx); } else { subdict = new TreeMap<MSSBamISOCountryPKey, MSSBamISOCountryBuff>(); dictByIANACodeIdx.put(newKeyIANACodeIdx, subdict); } subdict.put(pkey, Buff); subdict = dictByIOCCodeIdx.get(existingKeyIOCCodeIdx); if (subdict != null) { subdict.remove(pkey); } if (dictByIOCCodeIdx.containsKey(newKeyIOCCodeIdx)) { subdict = dictByIOCCodeIdx.get(newKeyIOCCodeIdx); } else { subdict = new TreeMap<MSSBamISOCountryPKey, MSSBamISOCountryBuff>(); dictByIOCCodeIdx.put(newKeyIOCCodeIdx, subdict); } subdict.put(pkey, Buff); subdict = dictByUNVCodeIdx.get(existingKeyUNVCodeIdx); if (subdict != null) { subdict.remove(pkey); } if (dictByUNVCodeIdx.containsKey(newKeyUNVCodeIdx)) { subdict = dictByUNVCodeIdx.get(newKeyUNVCodeIdx); } else { subdict = new TreeMap<MSSBamISOCountryPKey, MSSBamISOCountryBuff>(); dictByUNVCodeIdx.put(newKeyUNVCodeIdx, subdict); } subdict.put(pkey, Buff); subdict = dictByUNISOCodeIdx.get(existingKeyUNISOCodeIdx); if (subdict != null) { subdict.remove(pkey); } if (dictByUNISOCodeIdx.containsKey(newKeyUNISOCodeIdx)) { subdict = dictByUNISOCodeIdx.get(newKeyUNISOCodeIdx); } else { subdict = new TreeMap<MSSBamISOCountryPKey, MSSBamISOCountryBuff>(); dictByUNISOCodeIdx.put(newKeyUNISOCodeIdx, subdict); } subdict.put(pkey, Buff); subdict = dictByITUCallPrefixIdx.get(existingKeyITUCallPrefixIdx); if (subdict != null) { subdict.remove(pkey); } if (dictByITUCallPrefixIdx.containsKey(newKeyITUCallPrefixIdx)) { subdict = dictByITUCallPrefixIdx.get(newKeyITUCallPrefixIdx); } else { subdict = new TreeMap<MSSBamISOCountryPKey, MSSBamISOCountryBuff>(); dictByITUCallPrefixIdx.put(newKeyITUCallPrefixIdx, subdict); } subdict.put(pkey, Buff); }
From source file:net.sourceforge.msscodefactory.v1_11.MSSBamRam.MSSBamRamISOCountryTable.java
public void deleteISOCountry(MSSBamAuthorization Authorization, MSSBamISOCountryBuff Buff) { final String S_ProcName = "MSSBamRamISOCountryTable.deleteISOCountry() "; MSSBamISOCountryPKey pkey = schema.getFactoryISOCountry().newPKey(); pkey.setRequiredId(schema.nextISOCountryIdGen()); MSSBamISOCountryBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "deleteISOCountry", "Existing record not found", "ISOCountry", pkey); }/*from w ww. j a va 2 s .c o m*/ if (existing.getRequiredRevision() != Buff.getRequiredRevision()) { throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteISOCountry", pkey); } MSSBamISOCountryByISOCodeIdxKey keyISOCodeIdx = schema.getFactoryISOCountry().newISOCodeIdxKey(); keyISOCodeIdx.setRequiredISOCode(existing.getRequiredISOCode()); MSSBamISOCountryByISOCode3IdxKey keyISOCode3Idx = schema.getFactoryISOCountry().newISOCode3IdxKey(); keyISOCode3Idx.setRequiredISOCode3(existing.getRequiredISOCode3()); MSSBamISOCountryByIANACodeIdxKey keyIANACodeIdx = schema.getFactoryISOCountry().newIANACodeIdxKey(); keyIANACodeIdx.setOptionalIANACode(existing.getOptionalIANACode()); MSSBamISOCountryByIOCCodeIdxKey keyIOCCodeIdx = schema.getFactoryISOCountry().newIOCCodeIdxKey(); keyIOCCodeIdx.setOptionalIOCCode(existing.getOptionalIOCCode()); MSSBamISOCountryByUNVCodeIdxKey keyUNVCodeIdx = schema.getFactoryISOCountry().newUNVCodeIdxKey(); keyUNVCodeIdx.setOptionalUNVCode(existing.getOptionalUNVCode()); MSSBamISOCountryByUNISOCodeIdxKey keyUNISOCodeIdx = schema.getFactoryISOCountry().newUNISOCodeIdxKey(); keyUNISOCodeIdx.setOptionalUNISOCode(existing.getOptionalUNISOCode()); MSSBamISOCountryByITUCallPrefixIdxKey keyITUCallPrefixIdx = schema.getFactoryISOCountry() .newITUCallPrefixIdxKey(); keyITUCallPrefixIdx.setOptionalITUCallPrefix(existing.getOptionalITUCallPrefix()); // Validate reverse foreign keys if (schema.getTableISOCountryLanguage().readDerivedByCountryIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteISOCountry", "Container", "ISOCountryLanguageCountry", "ISOCountryLanguage", pkey); } if (schema.getTableISOCountryCurrency().readDerivedByCountryIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteISOCountry", "Container", "ISOCountryCurrencyCountry", "ISOCountryCurrency", pkey); } // Delete is valid SortedMap<MSSBamISOCountryPKey, MSSBamISOCountryBuff> subdict; dictByPKey.remove(pkey); dictByISOCodeIdx.remove(keyISOCodeIdx); dictByISOCode3Idx.remove(keyISOCode3Idx); subdict = dictByIANACodeIdx.get(keyIANACodeIdx); subdict.remove(pkey); subdict = dictByIOCCodeIdx.get(keyIOCCodeIdx); subdict.remove(pkey); subdict = dictByUNVCodeIdx.get(keyUNVCodeIdx); subdict.remove(pkey); subdict = dictByUNISOCodeIdx.get(keyUNISOCodeIdx); subdict.remove(pkey); subdict = dictByITUCallPrefixIdx.get(keyITUCallPrefixIdx); subdict.remove(pkey); }
From source file:net.sourceforge.msscodefactory.v1_11.MSSBamRam.MSSBamRamManufactureToolSetTable.java
public void updateManufactureToolSet(MSSBamAuthorization Authorization, MSSBamManufactureToolSetBuff Buff) { MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey(); pkey.setRequiredId(Buff.getRequiredId()); MSSBamManufactureToolSetBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateManufactureToolSet", "Existing record not found", "ManufactureToolSet", pkey); }/*from ww w. j av a 2s . c om*/ MSSBamManufactureToolSetByUTSNameIdxKey existingKeyUTSNameIdx = schema.getFactoryManufactureToolSet() .newUTSNameIdxKey(); existingKeyUTSNameIdx.setRequiredManufacturedId(existing.getRequiredManufacturedId()); existingKeyUTSNameIdx.setRequiredToolSetName(existing.getRequiredToolSetName()); MSSBamManufactureToolSetByUTSNameIdxKey newKeyUTSNameIdx = schema.getFactoryManufactureToolSet() .newUTSNameIdxKey(); newKeyUTSNameIdx.setRequiredManufacturedId(Buff.getRequiredManufacturedId()); newKeyUTSNameIdx.setRequiredToolSetName(Buff.getRequiredToolSetName()); MSSBamManufactureToolSetByManufacturedIdxKey existingKeyManufacturedIdx = schema .getFactoryManufactureToolSet().newManufacturedIdxKey(); existingKeyManufacturedIdx.setRequiredManufacturedId(existing.getRequiredManufacturedId()); MSSBamManufactureToolSetByManufacturedIdxKey newKeyManufacturedIdx = schema.getFactoryManufactureToolSet() .newManufacturedIdxKey(); newKeyManufacturedIdx.setRequiredManufacturedId(Buff.getRequiredManufacturedId()); // Check unique indexes if (!existingKeyUTSNameIdx.equals(newKeyUTSNameIdx)) { if (dictByUTSNameIdx.containsKey(newKeyUTSNameIdx)) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), "updateManufactureToolSet", "ManufactureToolSetUTSNameIdx", newKeyUTSNameIdx); } } // Validate foreign keys { boolean allNull = true; if (allNull) { if (null == schema.getTableAnyObj().readDerivedByIdIdx(Authorization, Buff.getRequiredId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateManufactureToolSet", "Superclass", "SuperClass", "AnyObj", null); } } } { boolean allNull = true; if (allNull) { if (null == schema.getTableScope().readDerivedByIdIdx(Authorization, Buff.getRequiredManufacturedId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateManufactureToolSet", "Container", "Manufactured", "Scope", null); } } } // Update is valid SortedMap<MSSBamAnyObjPKey, MSSBamManufactureToolSetBuff> subdict; dictByPKey.remove(pkey); dictByPKey.put(pkey, Buff); dictByUTSNameIdx.remove(existingKeyUTSNameIdx); dictByUTSNameIdx.put(newKeyUTSNameIdx, Buff); subdict = dictByManufacturedIdx.get(existingKeyManufacturedIdx); if (subdict != null) { subdict.remove(pkey); } if (dictByManufacturedIdx.containsKey(newKeyManufacturedIdx)) { subdict = dictByManufacturedIdx.get(newKeyManufacturedIdx); } else { subdict = new TreeMap<MSSBamAnyObjPKey, MSSBamManufactureToolSetBuff>(); dictByManufacturedIdx.put(newKeyManufacturedIdx, subdict); } subdict.put(pkey, Buff); }