List of usage examples for java.util SortedMap remove
V remove(Object key);
From source file:net.sourceforge.msscodefactory.v1_10.MSSBamRam.MSSBamRamRelationColTable.java
public void deleteRelationCol(MSSBamAuthorization Authorization, MSSBamRelationColBuff Buff) { final String S_ProcName = "MSSBamRamRelationColTable.deleteRelationCol() "; MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey(); pkey.setRequiredId(schema.nextAnyObjIdGen()); MSSBamRelationColBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "deleteRelationCol", "Existing record not found", "RelationCol", pkey); }/* w ww . j a v a2 s. c o m*/ if (existing.getRequiredRevision() != Buff.getRequiredRevision()) { throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteRelationCol", pkey); } MSSBamRelationColByRelationIdxKey keyRelationIdx = schema.getFactoryRelationCol().newRelationIdxKey(); keyRelationIdx.setRequiredRelationId(existing.getRequiredRelationId()); MSSBamRelationColByFromColIdxKey keyFromColIdx = schema.getFactoryRelationCol().newFromColIdxKey(); keyFromColIdx.setRequiredFromColId(existing.getRequiredFromColId()); MSSBamRelationColByToColIdxKey keyToColIdx = schema.getFactoryRelationCol().newToColIdxKey(); keyToColIdx.setRequiredToColId(existing.getRequiredToColId()); MSSBamRelationColByPrevIdxKey keyPrevIdx = schema.getFactoryRelationCol().newPrevIdxKey(); keyPrevIdx.setOptionalPrevId(existing.getOptionalPrevId()); MSSBamRelationColByNextIdxKey keyNextIdx = schema.getFactoryRelationCol().newNextIdxKey(); keyNextIdx.setOptionalNextId(existing.getOptionalNextId()); MSSBamRelationColByRelPrevIdxKey keyRelPrevIdx = schema.getFactoryRelationCol().newRelPrevIdxKey(); keyRelPrevIdx.setRequiredRelationId(existing.getRequiredRelationId()); keyRelPrevIdx.setOptionalPrevId(existing.getOptionalPrevId()); MSSBamRelationColByRelNextIdxKey keyRelNextIdx = schema.getFactoryRelationCol().newRelNextIdxKey(); keyRelNextIdx.setRequiredRelationId(existing.getRequiredRelationId()); keyRelNextIdx.setOptionalNextId(existing.getOptionalNextId()); // Validate reverse foreign keys // Delete is valid SortedMap<MSSBamAnyObjPKey, MSSBamRelationColBuff> subdict; dictByPKey.remove(pkey); subdict = dictByRelationIdx.get(keyRelationIdx); subdict.remove(pkey); subdict = dictByFromColIdx.get(keyFromColIdx); subdict.remove(pkey); subdict = dictByToColIdx.get(keyToColIdx); subdict.remove(pkey); subdict = dictByPrevIdx.get(keyPrevIdx); subdict.remove(pkey); subdict = dictByNextIdx.get(keyNextIdx); subdict.remove(pkey); subdict = dictByRelPrevIdx.get(keyRelPrevIdx); subdict.remove(pkey); subdict = dictByRelNextIdx.get(keyRelNextIdx); subdict.remove(pkey); }
From source file:net.sourceforge.msscodefactory.v1_10.MSSBamRam.MSSBamRamRelationTable.java
public void updateRelation(MSSBamAuthorization Authorization, MSSBamRelationBuff Buff) { MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey(); pkey.setRequiredId(Buff.getRequiredId()); MSSBamRelationBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateRelation", "Existing record not found", "Relation", pkey); }//from w w w .ja va2s. c om MSSBamRelationByRTypeKeyIdxKey existingKeyRTypeKeyIdx = schema.getFactoryRelation().newRTypeKeyIdxKey(); existingKeyRTypeKeyIdx.setRequiredRelationTypeId(existing.getRequiredRelationTypeId()); MSSBamRelationByRTypeKeyIdxKey newKeyRTypeKeyIdx = schema.getFactoryRelation().newRTypeKeyIdxKey(); newKeyRTypeKeyIdx.setRequiredRelationTypeId(Buff.getRequiredRelationTypeId()); MSSBamRelationByFromTblIdxKey existingKeyFromTblIdx = schema.getFactoryRelation().newFromTblIdxKey(); existingKeyFromTblIdx.setRequiredFromTableId(existing.getRequiredFromTableId()); MSSBamRelationByFromTblIdxKey newKeyFromTblIdx = schema.getFactoryRelation().newFromTblIdxKey(); newKeyFromTblIdx.setRequiredFromTableId(Buff.getRequiredFromTableId()); MSSBamRelationByFromKeyIdxKey existingKeyFromKeyIdx = schema.getFactoryRelation().newFromKeyIdxKey(); existingKeyFromKeyIdx.setRequiredFromIndexId(existing.getRequiredFromIndexId()); MSSBamRelationByFromKeyIdxKey newKeyFromKeyIdx = schema.getFactoryRelation().newFromKeyIdxKey(); newKeyFromKeyIdx.setRequiredFromIndexId(Buff.getRequiredFromIndexId()); MSSBamRelationByToTblIdxKey existingKeyToTblIdx = schema.getFactoryRelation().newToTblIdxKey(); existingKeyToTblIdx.setRequiredToTableId(existing.getRequiredToTableId()); MSSBamRelationByToTblIdxKey newKeyToTblIdx = schema.getFactoryRelation().newToTblIdxKey(); newKeyToTblIdx.setRequiredToTableId(Buff.getRequiredToTableId()); MSSBamRelationByToKeyIdxKey existingKeyToKeyIdx = schema.getFactoryRelation().newToKeyIdxKey(); existingKeyToKeyIdx.setRequiredToIndexId(existing.getRequiredToIndexId()); MSSBamRelationByToKeyIdxKey newKeyToKeyIdx = schema.getFactoryRelation().newToKeyIdxKey(); newKeyToKeyIdx.setRequiredToIndexId(Buff.getRequiredToIndexId()); MSSBamRelationByNarrowedIdxKey existingKeyNarrowedIdx = schema.getFactoryRelation().newNarrowedIdxKey(); existingKeyNarrowedIdx.setOptionalNarrowedId(existing.getOptionalNarrowedId()); MSSBamRelationByNarrowedIdxKey newKeyNarrowedIdx = schema.getFactoryRelation().newNarrowedIdxKey(); newKeyNarrowedIdx.setOptionalNarrowedId(Buff.getOptionalNarrowedId()); // Check unique indexes // Validate foreign keys { boolean allNull = true; if (allNull) { if (null == schema.getTableScope().readDerivedByIdIdx(Authorization, Buff.getRequiredId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateRelation", "Superclass", "SuperClass", "Scope", null); } } } { boolean allNull = true; if (allNull) { if (null == schema.getTableRelationType().readDerivedByIdIdx(Authorization, Buff.getRequiredRelationTypeId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateRelation", "Lookup", "RelationType", "RelationType", null); } } } { boolean allNull = true; if (allNull) { if (null == schema.getTableTable().readDerivedByIdIdx(Authorization, Buff.getRequiredFromTableId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateRelation", "Container", "FromTable", "Table", null); } } } { boolean allNull = true; if (allNull) { if (null == schema.getTableIndex().readDerivedByIdIdx(Authorization, Buff.getRequiredFromIndexId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateRelation", "Lookup", "FromIndex", "Index", null); } } } { boolean allNull = true; if (allNull) { if (null == schema.getTableTable().readDerivedByIdIdx(Authorization, Buff.getRequiredToTableId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateRelation", "Lookup", "ToTable", "Table", null); } } } { boolean allNull = true; if (allNull) { if (null == schema.getTableIndex().readDerivedByIdIdx(Authorization, Buff.getRequiredToIndexId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateRelation", "Lookup", "ToIndex", "Index", null); } } } // Update is valid SortedMap<MSSBamAnyObjPKey, MSSBamRelationBuff> subdict; dictByPKey.remove(pkey); dictByPKey.put(pkey, Buff); subdict = dictByRTypeKeyIdx.get(existingKeyRTypeKeyIdx); if (subdict != null) { subdict.remove(pkey); } if (dictByRTypeKeyIdx.containsKey(newKeyRTypeKeyIdx)) { subdict = dictByRTypeKeyIdx.get(newKeyRTypeKeyIdx); } else { subdict = new TreeMap<MSSBamAnyObjPKey, MSSBamRelationBuff>(); dictByRTypeKeyIdx.put(newKeyRTypeKeyIdx, subdict); } subdict.put(pkey, Buff); subdict = dictByFromTblIdx.get(existingKeyFromTblIdx); if (subdict != null) { subdict.remove(pkey); } if (dictByFromTblIdx.containsKey(newKeyFromTblIdx)) { subdict = dictByFromTblIdx.get(newKeyFromTblIdx); } else { subdict = new TreeMap<MSSBamAnyObjPKey, MSSBamRelationBuff>(); dictByFromTblIdx.put(newKeyFromTblIdx, subdict); } subdict.put(pkey, Buff); subdict = dictByFromKeyIdx.get(existingKeyFromKeyIdx); if (subdict != null) { subdict.remove(pkey); } if (dictByFromKeyIdx.containsKey(newKeyFromKeyIdx)) { subdict = dictByFromKeyIdx.get(newKeyFromKeyIdx); } else { subdict = new TreeMap<MSSBamAnyObjPKey, MSSBamRelationBuff>(); dictByFromKeyIdx.put(newKeyFromKeyIdx, subdict); } subdict.put(pkey, Buff); subdict = dictByToTblIdx.get(existingKeyToTblIdx); if (subdict != null) { subdict.remove(pkey); } if (dictByToTblIdx.containsKey(newKeyToTblIdx)) { subdict = dictByToTblIdx.get(newKeyToTblIdx); } else { subdict = new TreeMap<MSSBamAnyObjPKey, MSSBamRelationBuff>(); dictByToTblIdx.put(newKeyToTblIdx, subdict); } subdict.put(pkey, Buff); subdict = dictByToKeyIdx.get(existingKeyToKeyIdx); if (subdict != null) { subdict.remove(pkey); } if (dictByToKeyIdx.containsKey(newKeyToKeyIdx)) { subdict = dictByToKeyIdx.get(newKeyToKeyIdx); } else { subdict = new TreeMap<MSSBamAnyObjPKey, MSSBamRelationBuff>(); dictByToKeyIdx.put(newKeyToKeyIdx, subdict); } subdict.put(pkey, Buff); subdict = dictByNarrowedIdx.get(existingKeyNarrowedIdx); if (subdict != null) { subdict.remove(pkey); } if (dictByNarrowedIdx.containsKey(newKeyNarrowedIdx)) { subdict = dictByNarrowedIdx.get(newKeyNarrowedIdx); } else { subdict = new TreeMap<MSSBamAnyObjPKey, MSSBamRelationBuff>(); dictByNarrowedIdx.put(newKeyNarrowedIdx, subdict); } subdict.put(pkey, Buff); }
From source file:net.sourceforge.msscodefactory.v1_10.MSSBamRam.MSSBamRamRelationTable.java
public void deleteRelation(MSSBamAuthorization Authorization, MSSBamRelationBuff Buff) { final String S_ProcName = "MSSBamRamRelationTable.deleteRelation() "; MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey(); pkey.setRequiredId(schema.nextAnyObjIdGen()); MSSBamRelationBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "deleteRelation", "Existing record not found", "Relation", pkey); }/*from w w w .j a v a 2s.c o m*/ if (existing.getRequiredRevision() != Buff.getRequiredRevision()) { throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteRelation", pkey); } MSSBamRelationByRTypeKeyIdxKey keyRTypeKeyIdx = schema.getFactoryRelation().newRTypeKeyIdxKey(); keyRTypeKeyIdx.setRequiredRelationTypeId(existing.getRequiredRelationTypeId()); MSSBamRelationByFromTblIdxKey keyFromTblIdx = schema.getFactoryRelation().newFromTblIdxKey(); keyFromTblIdx.setRequiredFromTableId(existing.getRequiredFromTableId()); MSSBamRelationByFromKeyIdxKey keyFromKeyIdx = schema.getFactoryRelation().newFromKeyIdxKey(); keyFromKeyIdx.setRequiredFromIndexId(existing.getRequiredFromIndexId()); MSSBamRelationByToTblIdxKey keyToTblIdx = schema.getFactoryRelation().newToTblIdxKey(); keyToTblIdx.setRequiredToTableId(existing.getRequiredToTableId()); MSSBamRelationByToKeyIdxKey keyToKeyIdx = schema.getFactoryRelation().newToKeyIdxKey(); keyToKeyIdx.setRequiredToIndexId(existing.getRequiredToIndexId()); MSSBamRelationByNarrowedIdxKey keyNarrowedIdx = schema.getFactoryRelation().newNarrowedIdxKey(); keyNarrowedIdx.setOptionalNarrowedId(existing.getOptionalNarrowedId()); // Validate reverse foreign keys if (schema.getTableRelationCol().readDerivedByRelationIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteRelation", "Container", "Relation", "RelationCol", pkey); } if (schema.getTableChain().readDerivedByPrevRelIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteRelation", "Lookup", "PrevRelation", "Chain", pkey); } if (schema.getTableChain().readDerivedByNextRelIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteRelation", "Lookup", "NextRelation", "Chain", pkey); } // Delete is valid SortedMap<MSSBamAnyObjPKey, MSSBamRelationBuff> subdict; dictByPKey.remove(pkey); subdict = dictByRTypeKeyIdx.get(keyRTypeKeyIdx); subdict.remove(pkey); subdict = dictByFromTblIdx.get(keyFromTblIdx); subdict.remove(pkey); subdict = dictByFromKeyIdx.get(keyFromKeyIdx); subdict.remove(pkey); subdict = dictByToTblIdx.get(keyToTblIdx); subdict.remove(pkey); subdict = dictByToKeyIdx.get(keyToKeyIdx); subdict.remove(pkey); subdict = dictByNarrowedIdx.get(keyNarrowedIdx); subdict.remove(pkey); }
From source file:net.sourceforge.msscodefactory.v1_10.MSSBamRam.MSSBamRamSchemaBlobTable.java
public void updateSchemaBlob(MSSBamAuthorization Authorization, MSSBamSchemaBlobBuff Buff) { MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey(); pkey.setRequiredId(Buff.getRequiredId()); MSSBamSchemaBlobBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateSchemaBlob", "Existing record not found", "SchemaBlob", pkey); }/*from w w w .j a v a 2 s. c o m*/ MSSBamSchemaBlobByContainerIdxKey existingKeyContainerIdx = schema.getFactorySchemaBlob() .newContainerIdxKey(); existingKeyContainerIdx.setRequiredContainerId(existing.getRequiredContainerId()); MSSBamSchemaBlobByContainerIdxKey newKeyContainerIdx = schema.getFactorySchemaBlob().newContainerIdxKey(); newKeyContainerIdx.setRequiredContainerId(Buff.getRequiredContainerId()); // Check unique indexes // Validate foreign keys { boolean allNull = true; if (allNull) { if (null == schema.getTableBlobDef().readDerivedByIdIdx(Authorization, Buff.getRequiredId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateSchemaBlob", "Superclass", "SuperClass", "BlobDef", null); } } } { boolean allNull = true; if (allNull) { if (null == schema.getTableSchemaDef().readDerivedByIdIdx(Authorization, Buff.getRequiredContainerId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateSchemaBlob", "Container", "CSchema", "SchemaDef", null); } } } // Update is valid SortedMap<MSSBamAnyObjPKey, MSSBamSchemaBlobBuff> 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, MSSBamSchemaBlobBuff>(); dictByContainerIdx.put(newKeyContainerIdx, subdict); } subdict.put(pkey, Buff); }
From source file:net.sourceforge.msscodefactory.v1_10.MSSBamRam.MSSBamRamSchemaBlobTable.java
public void deleteSchemaBlob(MSSBamAuthorization Authorization, MSSBamSchemaBlobBuff Buff) { final String S_ProcName = "MSSBamRamSchemaBlobTable.deleteSchemaBlob() "; MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey(); pkey.setRequiredId(schema.nextAnyObjIdGen()); MSSBamSchemaBlobBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "deleteSchemaBlob", "Existing record not found", "SchemaBlob", pkey); }/*from www. j a v a 2s .c o m*/ if (existing.getRequiredRevision() != Buff.getRequiredRevision()) { throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteSchemaBlob", pkey); } MSSBamSchemaBlobByContainerIdxKey keyContainerIdx = schema.getFactorySchemaBlob().newContainerIdxKey(); keyContainerIdx.setRequiredContainerId(existing.getRequiredContainerId()); // Validate reverse foreign keys // Delete is valid SortedMap<MSSBamAnyObjPKey, MSSBamSchemaBlobBuff> subdict; dictByPKey.remove(pkey); subdict = dictByContainerIdx.get(keyContainerIdx); subdict.remove(pkey); }
From source file:net.sourceforge.msscodefactory.v1_10.MSSBamRam.MSSBamRamSchemaBoolTable.java
public void updateSchemaBool(MSSBamAuthorization Authorization, MSSBamSchemaBoolBuff Buff) { MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey(); pkey.setRequiredId(Buff.getRequiredId()); MSSBamSchemaBoolBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateSchemaBool", "Existing record not found", "SchemaBool", pkey); }//from w w w . j a v a2s .c om MSSBamSchemaBoolByContainerIdxKey existingKeyContainerIdx = schema.getFactorySchemaBool() .newContainerIdxKey(); existingKeyContainerIdx.setRequiredContainerId(existing.getRequiredContainerId()); MSSBamSchemaBoolByContainerIdxKey newKeyContainerIdx = schema.getFactorySchemaBool().newContainerIdxKey(); newKeyContainerIdx.setRequiredContainerId(Buff.getRequiredContainerId()); // Check unique indexes // Validate foreign keys { boolean allNull = true; if (allNull) { if (null == schema.getTableBoolDef().readDerivedByIdIdx(Authorization, Buff.getRequiredId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateSchemaBool", "Superclass", "SuperClass", "BoolDef", null); } } } { boolean allNull = true; if (allNull) { if (null == schema.getTableSchemaDef().readDerivedByIdIdx(Authorization, Buff.getRequiredContainerId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateSchemaBool", "Container", "CSchema", "SchemaDef", null); } } } // Update is valid SortedMap<MSSBamAnyObjPKey, MSSBamSchemaBoolBuff> 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, MSSBamSchemaBoolBuff>(); dictByContainerIdx.put(newKeyContainerIdx, subdict); } subdict.put(pkey, Buff); }
From source file:net.sourceforge.msscodefactory.v1_10.MSSBamRam.MSSBamRamSchemaBoolTable.java
public void deleteSchemaBool(MSSBamAuthorization Authorization, MSSBamSchemaBoolBuff Buff) { final String S_ProcName = "MSSBamRamSchemaBoolTable.deleteSchemaBool() "; MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey(); pkey.setRequiredId(schema.nextAnyObjIdGen()); MSSBamSchemaBoolBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "deleteSchemaBool", "Existing record not found", "SchemaBool", pkey); }/*from w w w . jav a 2s . c o m*/ if (existing.getRequiredRevision() != Buff.getRequiredRevision()) { throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteSchemaBool", pkey); } MSSBamSchemaBoolByContainerIdxKey keyContainerIdx = schema.getFactorySchemaBool().newContainerIdxKey(); keyContainerIdx.setRequiredContainerId(existing.getRequiredContainerId()); // Validate reverse foreign keys // Delete is valid SortedMap<MSSBamAnyObjPKey, MSSBamSchemaBoolBuff> subdict; dictByPKey.remove(pkey); subdict = dictByContainerIdx.get(keyContainerIdx); subdict.remove(pkey); }
From source file:net.sourceforge.msscodefactory.v1_10.MSSBamRam.MSSBamRamSchemaDateTable.java
public void updateSchemaDate(MSSBamAuthorization Authorization, MSSBamSchemaDateBuff Buff) { MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey(); pkey.setRequiredId(Buff.getRequiredId()); MSSBamSchemaDateBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateSchemaDate", "Existing record not found", "SchemaDate", pkey); }/*from ww w . j a v a2 s. c o m*/ MSSBamSchemaDateByContainerIdxKey existingKeyContainerIdx = schema.getFactorySchemaDate() .newContainerIdxKey(); existingKeyContainerIdx.setRequiredContainerId(existing.getRequiredContainerId()); MSSBamSchemaDateByContainerIdxKey newKeyContainerIdx = schema.getFactorySchemaDate().newContainerIdxKey(); newKeyContainerIdx.setRequiredContainerId(Buff.getRequiredContainerId()); // Check unique indexes // Validate foreign keys { boolean allNull = true; if (allNull) { if (null == schema.getTableDateDef().readDerivedByIdIdx(Authorization, Buff.getRequiredId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateSchemaDate", "Superclass", "SuperClass", "DateDef", null); } } } { boolean allNull = true; if (allNull) { if (null == schema.getTableSchemaDef().readDerivedByIdIdx(Authorization, Buff.getRequiredContainerId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateSchemaDate", "Container", "CSchema", "SchemaDef", null); } } } // Update is valid SortedMap<MSSBamAnyObjPKey, MSSBamSchemaDateBuff> 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, MSSBamSchemaDateBuff>(); dictByContainerIdx.put(newKeyContainerIdx, subdict); } subdict.put(pkey, Buff); }
From source file:net.sourceforge.msscodefactory.v1_10.MSSBamRam.MSSBamRamSchemaDateTable.java
public void deleteSchemaDate(MSSBamAuthorization Authorization, MSSBamSchemaDateBuff Buff) { final String S_ProcName = "MSSBamRamSchemaDateTable.deleteSchemaDate() "; MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey(); pkey.setRequiredId(schema.nextAnyObjIdGen()); MSSBamSchemaDateBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "deleteSchemaDate", "Existing record not found", "SchemaDate", pkey); }// w w w . jav a 2 s . c o m if (existing.getRequiredRevision() != Buff.getRequiredRevision()) { throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteSchemaDate", pkey); } MSSBamSchemaDateByContainerIdxKey keyContainerIdx = schema.getFactorySchemaDate().newContainerIdxKey(); keyContainerIdx.setRequiredContainerId(existing.getRequiredContainerId()); // Validate reverse foreign keys // Delete is valid SortedMap<MSSBamAnyObjPKey, MSSBamSchemaDateBuff> subdict; dictByPKey.remove(pkey); subdict = dictByContainerIdx.get(keyContainerIdx); subdict.remove(pkey); }
From source file:net.sourceforge.msscodefactory.v1_10.MSSBamRam.MSSBamRamSchemaDefTable.java
public void updateSchemaDef(MSSBamAuthorization Authorization, MSSBamSchemaDefBuff Buff) { MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey(); pkey.setRequiredId(Buff.getRequiredId()); MSSBamSchemaDefBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateSchemaDef", "Existing record not found", "SchemaDef", pkey); }/*from w ww . j a v a 2 s .c o m*/ MSSBamSchemaDefByVersionIdxKey existingKeyVersionIdx = schema.getFactorySchemaDef().newVersionIdxKey(); existingKeyVersionIdx.setRequiredVersionId(existing.getRequiredVersionId()); MSSBamSchemaDefByVersionIdxKey newKeyVersionIdx = schema.getFactorySchemaDef().newVersionIdxKey(); newKeyVersionIdx.setRequiredVersionId(Buff.getRequiredVersionId()); MSSBamSchemaDefByDefLcnIdxKey existingKeyDefLcnIdx = schema.getFactorySchemaDef().newDefLcnIdxKey(); existingKeyDefLcnIdx.setOptionalDefaultLicenseId(existing.getOptionalDefaultLicenseId()); MSSBamSchemaDefByDefLcnIdxKey newKeyDefLcnIdx = schema.getFactorySchemaDef().newDefLcnIdxKey(); newKeyDefLcnIdx.setOptionalDefaultLicenseId(Buff.getOptionalDefaultLicenseId()); MSSBamSchemaDefByDataScopeIdxKey existingKeyDataScopeIdx = schema.getFactorySchemaDef() .newDataScopeIdxKey(); existingKeyDataScopeIdx.setOptionalDataScopeId(existing.getOptionalDataScopeId()); MSSBamSchemaDefByDataScopeIdxKey newKeyDataScopeIdx = schema.getFactorySchemaDef().newDataScopeIdxKey(); newKeyDataScopeIdx.setOptionalDataScopeId(Buff.getOptionalDataScopeId()); MSSBamSchemaDefByVAccSecIdxKey existingKeyVAccSecIdx = schema.getFactorySchemaDef().newVAccSecIdxKey(); existingKeyVAccSecIdx.setOptionalViewAccessSecurityId(existing.getOptionalViewAccessSecurityId()); MSSBamSchemaDefByVAccSecIdxKey newKeyVAccSecIdx = schema.getFactorySchemaDef().newVAccSecIdxKey(); newKeyVAccSecIdx.setOptionalViewAccessSecurityId(Buff.getOptionalViewAccessSecurityId()); MSSBamSchemaDefByVAccFreqIdxKey existingKeyVAccFreqIdx = schema.getFactorySchemaDef().newVAccFreqIdxKey(); existingKeyVAccFreqIdx.setOptionalViewAccessFrequencyId(existing.getOptionalViewAccessFrequencyId()); MSSBamSchemaDefByVAccFreqIdxKey newKeyVAccFreqIdx = schema.getFactorySchemaDef().newVAccFreqIdxKey(); newKeyVAccFreqIdx.setOptionalViewAccessFrequencyId(Buff.getOptionalViewAccessFrequencyId()); MSSBamSchemaDefByEAccSecIdxKey existingKeyEAccSecIdx = schema.getFactorySchemaDef().newEAccSecIdxKey(); existingKeyEAccSecIdx.setOptionalEditAccessSecurityId(existing.getOptionalEditAccessSecurityId()); MSSBamSchemaDefByEAccSecIdxKey newKeyEAccSecIdx = schema.getFactorySchemaDef().newEAccSecIdxKey(); newKeyEAccSecIdx.setOptionalEditAccessSecurityId(Buff.getOptionalEditAccessSecurityId()); MSSBamSchemaDefByEAccFreqIdxKey existingKeyEAccFreqIdx = schema.getFactorySchemaDef().newEAccFreqIdxKey(); existingKeyEAccFreqIdx.setOptionalEditAccessFrequencyId(existing.getOptionalEditAccessFrequencyId()); MSSBamSchemaDefByEAccFreqIdxKey newKeyEAccFreqIdx = schema.getFactorySchemaDef().newEAccFreqIdxKey(); newKeyEAccFreqIdx.setOptionalEditAccessFrequencyId(Buff.getOptionalEditAccessFrequencyId()); // Check unique indexes // Validate foreign keys { boolean allNull = true; if (allNull) { if (null == schema.getTableScope().readDerivedByIdIdx(Authorization, Buff.getRequiredId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateSchemaDef", "Superclass", "SuperClass", "Scope", null); } } } { boolean allNull = true; if (allNull) { if (null == schema.getTableVersion().readDerivedByIdIdx(Authorization, Buff.getRequiredVersionId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateSchemaDef", "Container", "Version", "Version", null); } } } // Update is valid SortedMap<MSSBamAnyObjPKey, MSSBamSchemaDefBuff> subdict; dictByPKey.remove(pkey); dictByPKey.put(pkey, Buff); subdict = dictByVersionIdx.get(existingKeyVersionIdx); if (subdict != null) { subdict.remove(pkey); } if (dictByVersionIdx.containsKey(newKeyVersionIdx)) { subdict = dictByVersionIdx.get(newKeyVersionIdx); } else { subdict = new TreeMap<MSSBamAnyObjPKey, MSSBamSchemaDefBuff>(); dictByVersionIdx.put(newKeyVersionIdx, subdict); } subdict.put(pkey, Buff); subdict = dictByDefLcnIdx.get(existingKeyDefLcnIdx); if (subdict != null) { subdict.remove(pkey); } if (dictByDefLcnIdx.containsKey(newKeyDefLcnIdx)) { subdict = dictByDefLcnIdx.get(newKeyDefLcnIdx); } else { subdict = new TreeMap<MSSBamAnyObjPKey, MSSBamSchemaDefBuff>(); dictByDefLcnIdx.put(newKeyDefLcnIdx, subdict); } subdict.put(pkey, Buff); subdict = dictByDataScopeIdx.get(existingKeyDataScopeIdx); if (subdict != null) { subdict.remove(pkey); } if (dictByDataScopeIdx.containsKey(newKeyDataScopeIdx)) { subdict = dictByDataScopeIdx.get(newKeyDataScopeIdx); } else { subdict = new TreeMap<MSSBamAnyObjPKey, MSSBamSchemaDefBuff>(); dictByDataScopeIdx.put(newKeyDataScopeIdx, subdict); } subdict.put(pkey, Buff); subdict = dictByVAccSecIdx.get(existingKeyVAccSecIdx); if (subdict != null) { subdict.remove(pkey); } if (dictByVAccSecIdx.containsKey(newKeyVAccSecIdx)) { subdict = dictByVAccSecIdx.get(newKeyVAccSecIdx); } else { subdict = new TreeMap<MSSBamAnyObjPKey, MSSBamSchemaDefBuff>(); dictByVAccSecIdx.put(newKeyVAccSecIdx, subdict); } subdict.put(pkey, Buff); subdict = dictByVAccFreqIdx.get(existingKeyVAccFreqIdx); if (subdict != null) { subdict.remove(pkey); } if (dictByVAccFreqIdx.containsKey(newKeyVAccFreqIdx)) { subdict = dictByVAccFreqIdx.get(newKeyVAccFreqIdx); } else { subdict = new TreeMap<MSSBamAnyObjPKey, MSSBamSchemaDefBuff>(); dictByVAccFreqIdx.put(newKeyVAccFreqIdx, subdict); } subdict.put(pkey, Buff); subdict = dictByEAccSecIdx.get(existingKeyEAccSecIdx); if (subdict != null) { subdict.remove(pkey); } if (dictByEAccSecIdx.containsKey(newKeyEAccSecIdx)) { subdict = dictByEAccSecIdx.get(newKeyEAccSecIdx); } else { subdict = new TreeMap<MSSBamAnyObjPKey, MSSBamSchemaDefBuff>(); dictByEAccSecIdx.put(newKeyEAccSecIdx, subdict); } subdict.put(pkey, Buff); subdict = dictByEAccFreqIdx.get(existingKeyEAccFreqIdx); if (subdict != null) { subdict.remove(pkey); } if (dictByEAccFreqIdx.containsKey(newKeyEAccFreqIdx)) { subdict = dictByEAccFreqIdx.get(newKeyEAccFreqIdx); } else { subdict = new TreeMap<MSSBamAnyObjPKey, MSSBamSchemaDefBuff>(); dictByEAccFreqIdx.put(newKeyEAccFreqIdx, subdict); } subdict.put(pkey, Buff); }