List of usage examples for java.util SortedMap remove
V remove(Object key);
From source file:net.sourceforge.msscodefactory.v1_10.MSSBamRam.MSSBamRamSchemaDefTable.java
public void deleteSchemaDef(MSSBamAuthorization Authorization, MSSBamSchemaDefBuff Buff) { final String S_ProcName = "MSSBamRamSchemaDefTable.deleteSchemaDef() "; MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey(); pkey.setRequiredId(schema.nextAnyObjIdGen()); MSSBamSchemaDefBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "deleteSchemaDef", "Existing record not found", "SchemaDef", pkey); }//from w w w . j a v a2 s.co m if (existing.getRequiredRevision() != Buff.getRequiredRevision()) { throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteSchemaDef", pkey); } MSSBamSchemaDefByVersionIdxKey keyVersionIdx = schema.getFactorySchemaDef().newVersionIdxKey(); keyVersionIdx.setRequiredVersionId(existing.getRequiredVersionId()); MSSBamSchemaDefByDefLcnIdxKey keyDefLcnIdx = schema.getFactorySchemaDef().newDefLcnIdxKey(); keyDefLcnIdx.setOptionalDefaultLicenseId(existing.getOptionalDefaultLicenseId()); MSSBamSchemaDefByDataScopeIdxKey keyDataScopeIdx = schema.getFactorySchemaDef().newDataScopeIdxKey(); keyDataScopeIdx.setOptionalDataScopeId(existing.getOptionalDataScopeId()); MSSBamSchemaDefByVAccSecIdxKey keyVAccSecIdx = schema.getFactorySchemaDef().newVAccSecIdxKey(); keyVAccSecIdx.setOptionalViewAccessSecurityId(existing.getOptionalViewAccessSecurityId()); MSSBamSchemaDefByVAccFreqIdxKey keyVAccFreqIdx = schema.getFactorySchemaDef().newVAccFreqIdxKey(); keyVAccFreqIdx.setOptionalViewAccessFrequencyId(existing.getOptionalViewAccessFrequencyId()); MSSBamSchemaDefByEAccSecIdxKey keyEAccSecIdx = schema.getFactorySchemaDef().newEAccSecIdxKey(); keyEAccSecIdx.setOptionalEditAccessSecurityId(existing.getOptionalEditAccessSecurityId()); MSSBamSchemaDefByEAccFreqIdxKey keyEAccFreqIdx = schema.getFactorySchemaDef().newEAccFreqIdxKey(); keyEAccFreqIdx.setOptionalEditAccessFrequencyId(existing.getOptionalEditAccessFrequencyId()); // Validate reverse foreign keys if (schema.getTableTable().readDerivedBySchemaIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteSchemaDef", "Container", "Schema", "Table", pkey); } if (schema.getTableSchemaBlob().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteSchemaDef", "Container", "CSchema", "SchemaBlob", pkey); } if (schema.getTableSchemaBool().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteSchemaDef", "Container", "CSchema", "SchemaBool", pkey); } if (schema.getTableSchemaDate().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteSchemaDef", "Container", "CSchema", "SchemaDate", pkey); } if (schema.getTableSchemaDouble().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteSchemaDef", "Container", "CSchema", "SchemaDouble", pkey); } if (schema.getTableSchemaNumber().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteSchemaDef", "Container", "CSchema", "SchemaNumber", pkey); } if (schema.getTableSchemaFloat().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteSchemaDef", "Container", "CSchema", "SchemaFloat", pkey); } if (schema.getTableSchemaInt16().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteSchemaDef", "Container", "CSchema", "SchemaInt16", pkey); } if (schema.getTableSchemaEnum().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteSchemaDef", "Container", "CSchema", "SchemaEnum", pkey); } if (schema.getTableSchemaId16Gen().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteSchemaDef", "Container", "CSchema", "SchemaId16Gen", pkey); } if (schema.getTableSchemaUInt16().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteSchemaDef", "Container", "CSchema", "SchemaUInt16", pkey); } if (schema.getTableSchemaInt32().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteSchemaDef", "Container", "CSchema", "SchemaInt32", pkey); } if (schema.getTableSchemaId32Gen().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteSchemaDef", "Container", "CSchema", "SchemaId32Gen", pkey); } if (schema.getTableSchemaUInt32().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteSchemaDef", "Container", "CSchema", "SchemaUInt32", pkey); } if (schema.getTableSchemaInt64().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteSchemaDef", "Container", "CSchema", "SchemaInt64", pkey); } if (schema.getTableSchemaId64Gen().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteSchemaDef", "Container", "CSchema", "SchemaId64Gen", pkey); } if (schema.getTableSchemaUInt64().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteSchemaDef", "Container", "CSchema", "SchemaUInt64", pkey); } if (schema.getTableSchemaNmToken().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteSchemaDef", "Container", "CSchema", "SchemaNmToken", pkey); } if (schema.getTableSchemaNmTokens().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteSchemaDef", "Container", "CSchema", "SchemaNmTokens", pkey); } if (schema.getTableSchemaString().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteSchemaDef", "Container", "CSchema", "SchemaString", pkey); } if (schema.getTableSchemaTZDate().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteSchemaDef", "Container", "CSchema", "SchemaTZDate", pkey); } if (schema.getTableSchemaTZTime().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteSchemaDef", "Container", "CSchema", "SchemaTZTime", pkey); } if (schema.getTableSchemaTZTimestamp().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteSchemaDef", "Container", "CSchema", "SchemaTZTimestamp", pkey); } if (schema.getTableSchemaText().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteSchemaDef", "Container", "CSchema", "SchemaText", pkey); } if (schema.getTableSchemaTime().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteSchemaDef", "Container", "CSchema", "SchemaTime", pkey); } if (schema.getTableSchemaTimestamp().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteSchemaDef", "Container", "CSchema", "SchemaTimestamp", pkey); } if (schema.getTableSchemaToken().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteSchemaDef", "Container", "CSchema", "SchemaToken", pkey); } if (schema.getTableSchemaUuid().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteSchemaDef", "Container", "CSchema", "SchemaUuid", pkey); } if (schema.getTableSchemaUuidGen().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteSchemaDef", "Container", "CSchema", "SchemaUuidGen", pkey); } // Delete is valid SortedMap<MSSBamAnyObjPKey, MSSBamSchemaDefBuff> subdict; dictByPKey.remove(pkey); subdict = dictByVersionIdx.get(keyVersionIdx); subdict.remove(pkey); subdict = dictByDefLcnIdx.get(keyDefLcnIdx); subdict.remove(pkey); subdict = dictByDataScopeIdx.get(keyDataScopeIdx); subdict.remove(pkey); subdict = dictByVAccSecIdx.get(keyVAccSecIdx); subdict.remove(pkey); subdict = dictByVAccFreqIdx.get(keyVAccFreqIdx); subdict.remove(pkey); subdict = dictByEAccSecIdx.get(keyEAccSecIdx); subdict.remove(pkey); subdict = dictByEAccFreqIdx.get(keyEAccFreqIdx); subdict.remove(pkey); }
From source file:net.sourceforge.msscodefactory.v1_10.MSSBamRam.MSSBamRamSchemaDoubleTable.java
public void updateSchemaDouble(MSSBamAuthorization Authorization, MSSBamSchemaDoubleBuff Buff) { MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey(); pkey.setRequiredId(Buff.getRequiredId()); MSSBamSchemaDoubleBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateSchemaDouble", "Existing record not found", "SchemaDouble", pkey); }// w w w . j a va2 s. com MSSBamSchemaDoubleByContainerIdxKey existingKeyContainerIdx = schema.getFactorySchemaDouble() .newContainerIdxKey(); existingKeyContainerIdx.setRequiredContainerId(existing.getRequiredContainerId()); MSSBamSchemaDoubleByContainerIdxKey newKeyContainerIdx = schema.getFactorySchemaDouble() .newContainerIdxKey(); newKeyContainerIdx.setRequiredContainerId(Buff.getRequiredContainerId()); // Check unique indexes // Validate foreign keys { boolean allNull = true; if (allNull) { if (null == schema.getTableDoubleDef().readDerivedByIdIdx(Authorization, Buff.getRequiredId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateSchemaDouble", "Superclass", "SuperClass", "DoubleDef", null); } } } { boolean allNull = true; if (allNull) { if (null == schema.getTableSchemaDef().readDerivedByIdIdx(Authorization, Buff.getRequiredContainerId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateSchemaDouble", "Container", "CSchema", "SchemaDef", null); } } } // Update is valid SortedMap<MSSBamAnyObjPKey, MSSBamSchemaDoubleBuff> subdict; dictByPKey.remove(pkey); dictByPKey.put(pkey, Buff); subdict = dictByContainerIdx.get(existingKeyContainerIdx); if (subdict != null) { subdict.remove(pkey); } if (dictByContainerIdx.containsKey(newKeyContainerIdx)) { subdict = dictByContainerIdx.get(newKeyContainerIdx); } else { subdict = new TreeMap<MSSBamAnyObjPKey, MSSBamSchemaDoubleBuff>(); dictByContainerIdx.put(newKeyContainerIdx, subdict); } subdict.put(pkey, Buff); }
From source file:net.sourceforge.msscodefactory.v1_10.MSSBamRam.MSSBamRamSchemaDoubleTable.java
public void deleteSchemaDouble(MSSBamAuthorization Authorization, MSSBamSchemaDoubleBuff Buff) { final String S_ProcName = "MSSBamRamSchemaDoubleTable.deleteSchemaDouble() "; MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey(); pkey.setRequiredId(schema.nextAnyObjIdGen()); MSSBamSchemaDoubleBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "deleteSchemaDouble", "Existing record not found", "SchemaDouble", pkey); }/* w ww. j a v a2 s. co m*/ if (existing.getRequiredRevision() != Buff.getRequiredRevision()) { throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteSchemaDouble", pkey); } MSSBamSchemaDoubleByContainerIdxKey keyContainerIdx = schema.getFactorySchemaDouble().newContainerIdxKey(); keyContainerIdx.setRequiredContainerId(existing.getRequiredContainerId()); // Validate reverse foreign keys // Delete is valid SortedMap<MSSBamAnyObjPKey, MSSBamSchemaDoubleBuff> subdict; dictByPKey.remove(pkey); subdict = dictByContainerIdx.get(keyContainerIdx); subdict.remove(pkey); }
From source file:net.sourceforge.msscodefactory.v1_10.MSSBamRam.MSSBamRamSchemaEnumTable.java
public void updateSchemaEnum(MSSBamAuthorization Authorization, MSSBamSchemaEnumBuff Buff) { MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey(); pkey.setRequiredId(Buff.getRequiredId()); MSSBamSchemaEnumBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateSchemaEnum", "Existing record not found", "SchemaEnum", pkey); }/*from w w w . java 2 s . co m*/ MSSBamSchemaEnumByContainerIdxKey existingKeyContainerIdx = schema.getFactorySchemaEnum() .newContainerIdxKey(); existingKeyContainerIdx.setRequiredContainerId(existing.getRequiredContainerId()); MSSBamSchemaEnumByContainerIdxKey newKeyContainerIdx = schema.getFactorySchemaEnum().newContainerIdxKey(); newKeyContainerIdx.setRequiredContainerId(Buff.getRequiredContainerId()); // Check unique indexes // Validate foreign keys { boolean allNull = true; if (allNull) { if (null == schema.getTableEnumDef().readDerivedByIdIdx(Authorization, Buff.getRequiredId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateSchemaEnum", "Superclass", "SuperClass", "EnumDef", null); } } } { boolean allNull = true; if (allNull) { if (null == schema.getTableSchemaDef().readDerivedByIdIdx(Authorization, Buff.getRequiredContainerId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateSchemaEnum", "Container", "CSchema", "SchemaDef", null); } } } // Update is valid SortedMap<MSSBamAnyObjPKey, MSSBamSchemaEnumBuff> subdict; dictByPKey.remove(pkey); dictByPKey.put(pkey, Buff); subdict = dictByContainerIdx.get(existingKeyContainerIdx); if (subdict != null) { subdict.remove(pkey); } if (dictByContainerIdx.containsKey(newKeyContainerIdx)) { subdict = dictByContainerIdx.get(newKeyContainerIdx); } else { subdict = new TreeMap<MSSBamAnyObjPKey, MSSBamSchemaEnumBuff>(); dictByContainerIdx.put(newKeyContainerIdx, subdict); } subdict.put(pkey, Buff); }
From source file:net.sourceforge.msscodefactory.v1_10.MSSBamRam.MSSBamRamSchemaEnumTable.java
public void deleteSchemaEnum(MSSBamAuthorization Authorization, MSSBamSchemaEnumBuff Buff) { final String S_ProcName = "MSSBamRamSchemaEnumTable.deleteSchemaEnum() "; MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey(); pkey.setRequiredId(schema.nextAnyObjIdGen()); MSSBamSchemaEnumBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "deleteSchemaEnum", "Existing record not found", "SchemaEnum", pkey); }/*w w w . j a v a 2s . c om*/ if (existing.getRequiredRevision() != Buff.getRequiredRevision()) { throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteSchemaEnum", pkey); } MSSBamSchemaEnumByContainerIdxKey keyContainerIdx = schema.getFactorySchemaEnum().newContainerIdxKey(); keyContainerIdx.setRequiredContainerId(existing.getRequiredContainerId()); // Validate reverse foreign keys // Delete is valid SortedMap<MSSBamAnyObjPKey, MSSBamSchemaEnumBuff> subdict; dictByPKey.remove(pkey); subdict = dictByContainerIdx.get(keyContainerIdx); subdict.remove(pkey); }
From source file:net.sourceforge.msscodefactory.v1_10.MSSBamRam.MSSBamRamSchemaFloatTable.java
public void updateSchemaFloat(MSSBamAuthorization Authorization, MSSBamSchemaFloatBuff Buff) { MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey(); pkey.setRequiredId(Buff.getRequiredId()); MSSBamSchemaFloatBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateSchemaFloat", "Existing record not found", "SchemaFloat", pkey); }//from ww w .j a v a 2 s . co m MSSBamSchemaFloatByContainerIdxKey existingKeyContainerIdx = schema.getFactorySchemaFloat() .newContainerIdxKey(); existingKeyContainerIdx.setRequiredContainerId(existing.getRequiredContainerId()); MSSBamSchemaFloatByContainerIdxKey newKeyContainerIdx = schema.getFactorySchemaFloat().newContainerIdxKey(); newKeyContainerIdx.setRequiredContainerId(Buff.getRequiredContainerId()); // Check unique indexes // Validate foreign keys { boolean allNull = true; if (allNull) { if (null == schema.getTableFloatDef().readDerivedByIdIdx(Authorization, Buff.getRequiredId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateSchemaFloat", "Superclass", "SuperClass", "FloatDef", null); } } } { boolean allNull = true; if (allNull) { if (null == schema.getTableSchemaDef().readDerivedByIdIdx(Authorization, Buff.getRequiredContainerId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateSchemaFloat", "Container", "CSchema", "SchemaDef", null); } } } // Update is valid SortedMap<MSSBamAnyObjPKey, MSSBamSchemaFloatBuff> subdict; dictByPKey.remove(pkey); dictByPKey.put(pkey, Buff); subdict = dictByContainerIdx.get(existingKeyContainerIdx); if (subdict != null) { subdict.remove(pkey); } if (dictByContainerIdx.containsKey(newKeyContainerIdx)) { subdict = dictByContainerIdx.get(newKeyContainerIdx); } else { subdict = new TreeMap<MSSBamAnyObjPKey, MSSBamSchemaFloatBuff>(); dictByContainerIdx.put(newKeyContainerIdx, subdict); } subdict.put(pkey, Buff); }
From source file:net.sourceforge.msscodefactory.v1_10.MSSBamRam.MSSBamRamSchemaFloatTable.java
public void deleteSchemaFloat(MSSBamAuthorization Authorization, MSSBamSchemaFloatBuff Buff) { final String S_ProcName = "MSSBamRamSchemaFloatTable.deleteSchemaFloat() "; MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey(); pkey.setRequiredId(schema.nextAnyObjIdGen()); MSSBamSchemaFloatBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "deleteSchemaFloat", "Existing record not found", "SchemaFloat", pkey); }// w w w .j ava 2 s .c o m if (existing.getRequiredRevision() != Buff.getRequiredRevision()) { throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteSchemaFloat", pkey); } MSSBamSchemaFloatByContainerIdxKey keyContainerIdx = schema.getFactorySchemaFloat().newContainerIdxKey(); keyContainerIdx.setRequiredContainerId(existing.getRequiredContainerId()); // Validate reverse foreign keys // Delete is valid SortedMap<MSSBamAnyObjPKey, MSSBamSchemaFloatBuff> subdict; dictByPKey.remove(pkey); subdict = dictByContainerIdx.get(keyContainerIdx); subdict.remove(pkey); }
From source file:net.sourceforge.msscodefactory.v1_10.MSSBamRam.MSSBamRamSchemaId16GenTable.java
public void updateSchemaId16Gen(MSSBamAuthorization Authorization, MSSBamSchemaId16GenBuff Buff) { MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey(); pkey.setRequiredId(Buff.getRequiredId()); MSSBamSchemaId16GenBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateSchemaId16Gen", "Existing record not found", "SchemaId16Gen", pkey); }//from ww w . j ava 2 s. c om MSSBamSchemaId16GenByContainerIdxKey existingKeyContainerIdx = schema.getFactorySchemaId16Gen() .newContainerIdxKey(); existingKeyContainerIdx.setRequiredContainerId(existing.getRequiredContainerId()); MSSBamSchemaId16GenByContainerIdxKey newKeyContainerIdx = schema.getFactorySchemaId16Gen() .newContainerIdxKey(); newKeyContainerIdx.setRequiredContainerId(Buff.getRequiredContainerId()); // Check unique indexes // Validate foreign keys { boolean allNull = true; if (allNull) { if (null == schema.getTableId16GenDef().readDerivedByIdIdx(Authorization, Buff.getRequiredId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateSchemaId16Gen", "Superclass", "SuperClass", "Id16GenDef", null); } } } { boolean allNull = true; if (allNull) { if (null == schema.getTableSchemaDef().readDerivedByIdIdx(Authorization, Buff.getRequiredContainerId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateSchemaId16Gen", "Container", "CSchema", "SchemaDef", null); } } } // Update is valid SortedMap<MSSBamAnyObjPKey, MSSBamSchemaId16GenBuff> subdict; dictByPKey.remove(pkey); dictByPKey.put(pkey, Buff); subdict = dictByContainerIdx.get(existingKeyContainerIdx); if (subdict != null) { subdict.remove(pkey); } if (dictByContainerIdx.containsKey(newKeyContainerIdx)) { subdict = dictByContainerIdx.get(newKeyContainerIdx); } else { subdict = new TreeMap<MSSBamAnyObjPKey, MSSBamSchemaId16GenBuff>(); dictByContainerIdx.put(newKeyContainerIdx, subdict); } subdict.put(pkey, Buff); }
From source file:net.sourceforge.msscodefactory.v1_10.MSSBamRam.MSSBamRamSchemaId16GenTable.java
public void deleteSchemaId16Gen(MSSBamAuthorization Authorization, MSSBamSchemaId16GenBuff Buff) { final String S_ProcName = "MSSBamRamSchemaId16GenTable.deleteSchemaId16Gen() "; MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey(); pkey.setRequiredId(schema.nextAnyObjIdGen()); MSSBamSchemaId16GenBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "deleteSchemaId16Gen", "Existing record not found", "SchemaId16Gen", pkey); }/* w ww .j ava 2 s .co m*/ if (existing.getRequiredRevision() != Buff.getRequiredRevision()) { throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteSchemaId16Gen", pkey); } MSSBamSchemaId16GenByContainerIdxKey keyContainerIdx = schema.getFactorySchemaId16Gen() .newContainerIdxKey(); keyContainerIdx.setRequiredContainerId(existing.getRequiredContainerId()); // Validate reverse foreign keys // Delete is valid SortedMap<MSSBamAnyObjPKey, MSSBamSchemaId16GenBuff> subdict; dictByPKey.remove(pkey); subdict = dictByContainerIdx.get(keyContainerIdx); subdict.remove(pkey); }
From source file:net.sourceforge.msscodefactory.v1_10.MSSBamRam.MSSBamRamSchemaId32GenTable.java
public void updateSchemaId32Gen(MSSBamAuthorization Authorization, MSSBamSchemaId32GenBuff Buff) { MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey(); pkey.setRequiredId(Buff.getRequiredId()); MSSBamSchemaId32GenBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateSchemaId32Gen", "Existing record not found", "SchemaId32Gen", pkey); }//from ww w .j a va2s. c om MSSBamSchemaId32GenByContainerIdxKey existingKeyContainerIdx = schema.getFactorySchemaId32Gen() .newContainerIdxKey(); existingKeyContainerIdx.setRequiredContainerId(existing.getRequiredContainerId()); MSSBamSchemaId32GenByContainerIdxKey newKeyContainerIdx = schema.getFactorySchemaId32Gen() .newContainerIdxKey(); newKeyContainerIdx.setRequiredContainerId(Buff.getRequiredContainerId()); // Check unique indexes // Validate foreign keys { boolean allNull = true; if (allNull) { if (null == schema.getTableId32GenDef().readDerivedByIdIdx(Authorization, Buff.getRequiredId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateSchemaId32Gen", "Superclass", "SuperClass", "Id32GenDef", null); } } } { boolean allNull = true; if (allNull) { if (null == schema.getTableSchemaDef().readDerivedByIdIdx(Authorization, Buff.getRequiredContainerId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateSchemaId32Gen", "Container", "CSchema", "SchemaDef", null); } } } // Update is valid SortedMap<MSSBamAnyObjPKey, MSSBamSchemaId32GenBuff> subdict; dictByPKey.remove(pkey); dictByPKey.put(pkey, Buff); subdict = dictByContainerIdx.get(existingKeyContainerIdx); if (subdict != null) { subdict.remove(pkey); } if (dictByContainerIdx.containsKey(newKeyContainerIdx)) { subdict = dictByContainerIdx.get(newKeyContainerIdx); } else { subdict = new TreeMap<MSSBamAnyObjPKey, MSSBamSchemaId32GenBuff>(); dictByContainerIdx.put(newKeyContainerIdx, subdict); } subdict.put(pkey, Buff); }