List of usage examples for java.util SortedMap remove
V remove(Object key);
From source file:net.sourceforge.msscodefactory.v1_10.MSSBamRam.MSSBamRamTableNumberTable.java
public void deleteTableNumber(MSSBamAuthorization Authorization, MSSBamTableNumberBuff Buff) { final String S_ProcName = "MSSBamRamTableNumberTable.deleteTableNumber() "; MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey(); pkey.setRequiredId(schema.nextAnyObjIdGen()); MSSBamTableNumberBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "deleteTableNumber", "Existing record not found", "TableNumber", pkey); }/* w w w . ja v a2 s . c o m*/ if (existing.getRequiredRevision() != Buff.getRequiredRevision()) { throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteTableNumber", pkey); } MSSBamTableNumberByContainerIdxKey keyContainerIdx = schema.getFactoryTableNumber().newContainerIdxKey(); keyContainerIdx.setRequiredContainerId(existing.getRequiredContainerId()); // Validate reverse foreign keys // Delete is valid SortedMap<MSSBamAnyObjPKey, MSSBamTableNumberBuff> subdict; dictByPKey.remove(pkey); subdict = dictByContainerIdx.get(keyContainerIdx); subdict.remove(pkey); }
From source file:net.sourceforge.msscodefactory.v1_10.MSSBamRam.MSSBamRamTableStringTable.java
public void updateTableString(MSSBamAuthorization Authorization, MSSBamTableStringBuff Buff) { MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey(); pkey.setRequiredId(Buff.getRequiredId()); MSSBamTableStringBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateTableString", "Existing record not found", "TableString", pkey); }/* w w w . ja v a 2 s. co m*/ MSSBamTableStringByContainerIdxKey existingKeyContainerIdx = schema.getFactoryTableString() .newContainerIdxKey(); existingKeyContainerIdx.setRequiredContainerId(existing.getRequiredContainerId()); MSSBamTableStringByContainerIdxKey newKeyContainerIdx = schema.getFactoryTableString().newContainerIdxKey(); newKeyContainerIdx.setRequiredContainerId(Buff.getRequiredContainerId()); // Check unique indexes // Validate foreign keys { boolean allNull = true; if (allNull) { if (null == schema.getTableStringDef().readDerivedByIdIdx(Authorization, Buff.getRequiredId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateTableString", "Superclass", "SuperClass", "StringDef", null); } } } { boolean allNull = true; if (allNull) { if (null == schema.getTableTable().readDerivedByIdIdx(Authorization, Buff.getRequiredContainerId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateTableString", "Container", "CTable", "Table", null); } } } // Update is valid SortedMap<MSSBamAnyObjPKey, MSSBamTableStringBuff> 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, MSSBamTableStringBuff>(); dictByContainerIdx.put(newKeyContainerIdx, subdict); } subdict.put(pkey, Buff); }
From source file:net.sourceforge.msscodefactory.v1_10.MSSBamRam.MSSBamRamTableStringTable.java
public void deleteTableString(MSSBamAuthorization Authorization, MSSBamTableStringBuff Buff) { final String S_ProcName = "MSSBamRamTableStringTable.deleteTableString() "; MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey(); pkey.setRequiredId(schema.nextAnyObjIdGen()); MSSBamTableStringBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "deleteTableString", "Existing record not found", "TableString", pkey); }//from ww w.jav a 2 s.c o m if (existing.getRequiredRevision() != Buff.getRequiredRevision()) { throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteTableString", pkey); } MSSBamTableStringByContainerIdxKey keyContainerIdx = schema.getFactoryTableString().newContainerIdxKey(); keyContainerIdx.setRequiredContainerId(existing.getRequiredContainerId()); // Validate reverse foreign keys // Delete is valid SortedMap<MSSBamAnyObjPKey, MSSBamTableStringBuff> subdict; dictByPKey.remove(pkey); subdict = dictByContainerIdx.get(keyContainerIdx); subdict.remove(pkey); }
From source file:net.sourceforge.msscodefactory.v1_10.MSSBamRam.MSSBamRamTableTable.java
public void updateTable(MSSBamAuthorization Authorization, MSSBamTableBuff Buff) { MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey(); pkey.setRequiredId(Buff.getRequiredId()); MSSBamTableBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateTable", "Existing record not found", "Table", pkey); }//from w w w. j a va 2s. c om MSSBamTableBySchemaIdxKey existingKeySchemaIdx = schema.getFactoryTable().newSchemaIdxKey(); existingKeySchemaIdx.setRequiredSchemaId(existing.getRequiredSchemaId()); MSSBamTableBySchemaIdxKey newKeySchemaIdx = schema.getFactoryTable().newSchemaIdxKey(); newKeySchemaIdx.setRequiredSchemaId(Buff.getRequiredSchemaId()); MSSBamTableBySchemaCdIdxKey existingKeySchemaCdIdx = schema.getFactoryTable().newSchemaCdIdxKey(); existingKeySchemaCdIdx.setRequiredSchemaId(existing.getRequiredSchemaId()); existingKeySchemaCdIdx.setRequiredTableClassCode(existing.getRequiredTableClassCode()); MSSBamTableBySchemaCdIdxKey newKeySchemaCdIdx = schema.getFactoryTable().newSchemaCdIdxKey(); newKeySchemaCdIdx.setRequiredSchemaId(Buff.getRequiredSchemaId()); newKeySchemaCdIdx.setRequiredTableClassCode(Buff.getRequiredTableClassCode()); MSSBamTableByPrimaryIndexIdxKey existingKeyPrimaryIndexIdx = schema.getFactoryTable() .newPrimaryIndexIdxKey(); existingKeyPrimaryIndexIdx.setOptionalPrimaryIndexId(existing.getOptionalPrimaryIndexId()); MSSBamTableByPrimaryIndexIdxKey newKeyPrimaryIndexIdx = schema.getFactoryTable().newPrimaryIndexIdxKey(); newKeyPrimaryIndexIdx.setOptionalPrimaryIndexId(Buff.getOptionalPrimaryIndexId()); MSSBamTableBySuperClassDefIdxKey existingKeySuperClassDefIdx = schema.getFactoryTable() .newSuperClassDefIdxKey(); existingKeySuperClassDefIdx.setOptionalSuperClassDefId(existing.getOptionalSuperClassDefId()); MSSBamTableBySuperClassDefIdxKey newKeySuperClassDefIdx = schema.getFactoryTable().newSuperClassDefIdxKey(); newKeySuperClassDefIdx.setOptionalSuperClassDefId(Buff.getOptionalSuperClassDefId()); MSSBamTableByDataScopeIdxKey existingKeyDataScopeIdx = schema.getFactoryTable().newDataScopeIdxKey(); existingKeyDataScopeIdx.setOptionalDataScopeId(existing.getOptionalDataScopeId()); MSSBamTableByDataScopeIdxKey newKeyDataScopeIdx = schema.getFactoryTable().newDataScopeIdxKey(); newKeyDataScopeIdx.setOptionalDataScopeId(Buff.getOptionalDataScopeId()); MSSBamTableByVAccSecIdxKey existingKeyVAccSecIdx = schema.getFactoryTable().newVAccSecIdxKey(); existingKeyVAccSecIdx.setOptionalViewAccessSecurityId(existing.getOptionalViewAccessSecurityId()); MSSBamTableByVAccSecIdxKey newKeyVAccSecIdx = schema.getFactoryTable().newVAccSecIdxKey(); newKeyVAccSecIdx.setOptionalViewAccessSecurityId(Buff.getOptionalViewAccessSecurityId()); MSSBamTableByVAccFreqIdxKey existingKeyVAccFreqIdx = schema.getFactoryTable().newVAccFreqIdxKey(); existingKeyVAccFreqIdx.setOptionalViewAccessFrequencyId(existing.getOptionalViewAccessFrequencyId()); MSSBamTableByVAccFreqIdxKey newKeyVAccFreqIdx = schema.getFactoryTable().newVAccFreqIdxKey(); newKeyVAccFreqIdx.setOptionalViewAccessFrequencyId(Buff.getOptionalViewAccessFrequencyId()); MSSBamTableByEAccSecIdxKey existingKeyEAccSecIdx = schema.getFactoryTable().newEAccSecIdxKey(); existingKeyEAccSecIdx.setOptionalEditAccessSecurityId(existing.getOptionalEditAccessSecurityId()); MSSBamTableByEAccSecIdxKey newKeyEAccSecIdx = schema.getFactoryTable().newEAccSecIdxKey(); newKeyEAccSecIdx.setOptionalEditAccessSecurityId(Buff.getOptionalEditAccessSecurityId()); MSSBamTableByEAccFreqIdxKey existingKeyEAccFreqIdx = schema.getFactoryTable().newEAccFreqIdxKey(); existingKeyEAccFreqIdx.setOptionalEditAccessFrequencyId(existing.getOptionalEditAccessFrequencyId()); MSSBamTableByEAccFreqIdxKey newKeyEAccFreqIdx = schema.getFactoryTable().newEAccFreqIdxKey(); newKeyEAccFreqIdx.setOptionalEditAccessFrequencyId(Buff.getOptionalEditAccessFrequencyId()); // Check unique indexes if (!existingKeySchemaCdIdx.equals(newKeySchemaCdIdx)) { if (dictBySchemaCdIdx.containsKey(newKeySchemaCdIdx)) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), "updateTable", "TableSchemaCodeIdx", newKeySchemaCdIdx); } } // Validate foreign keys { boolean allNull = true; if (allNull) { if (null == schema.getTableScope().readDerivedByIdIdx(Authorization, Buff.getRequiredId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateTable", "Superclass", "SuperClass", "Scope", null); } } } { boolean allNull = true; if (allNull) { if (null == schema.getTableSchemaDef().readDerivedByIdIdx(Authorization, Buff.getRequiredSchemaId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateTable", "Container", "Schema", "SchemaDef", null); } } } // Update is valid SortedMap<MSSBamAnyObjPKey, MSSBamTableBuff> subdict; dictByPKey.remove(pkey); dictByPKey.put(pkey, Buff); subdict = dictBySchemaIdx.get(existingKeySchemaIdx); if (subdict != null) { subdict.remove(pkey); } if (dictBySchemaIdx.containsKey(newKeySchemaIdx)) { subdict = dictBySchemaIdx.get(newKeySchemaIdx); } else { subdict = new TreeMap<MSSBamAnyObjPKey, MSSBamTableBuff>(); dictBySchemaIdx.put(newKeySchemaIdx, subdict); } subdict.put(pkey, Buff); dictBySchemaCdIdx.remove(existingKeySchemaCdIdx); dictBySchemaCdIdx.put(newKeySchemaCdIdx, Buff); subdict = dictByPrimaryIndexIdx.get(existingKeyPrimaryIndexIdx); if (subdict != null) { subdict.remove(pkey); } if (dictByPrimaryIndexIdx.containsKey(newKeyPrimaryIndexIdx)) { subdict = dictByPrimaryIndexIdx.get(newKeyPrimaryIndexIdx); } else { subdict = new TreeMap<MSSBamAnyObjPKey, MSSBamTableBuff>(); dictByPrimaryIndexIdx.put(newKeyPrimaryIndexIdx, subdict); } subdict.put(pkey, Buff); subdict = dictBySuperClassDefIdx.get(existingKeySuperClassDefIdx); if (subdict != null) { subdict.remove(pkey); } if (dictBySuperClassDefIdx.containsKey(newKeySuperClassDefIdx)) { subdict = dictBySuperClassDefIdx.get(newKeySuperClassDefIdx); } else { subdict = new TreeMap<MSSBamAnyObjPKey, MSSBamTableBuff>(); dictBySuperClassDefIdx.put(newKeySuperClassDefIdx, 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, MSSBamTableBuff>(); 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, MSSBamTableBuff>(); 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, MSSBamTableBuff>(); 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, MSSBamTableBuff>(); 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, MSSBamTableBuff>(); dictByEAccFreqIdx.put(newKeyEAccFreqIdx, subdict); } subdict.put(pkey, Buff); }
From source file:net.sourceforge.msscodefactory.v1_10.MSSBamRam.MSSBamRamTableTable.java
public void deleteTable(MSSBamAuthorization Authorization, MSSBamTableBuff Buff) { final String S_ProcName = "MSSBamRamTableTable.deleteTable() "; MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey(); pkey.setRequiredId(schema.nextAnyObjIdGen()); MSSBamTableBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "deleteTable", "Existing record not found", "Table", pkey); }/*w ww .j a v a2 s .c o m*/ if (existing.getRequiredRevision() != Buff.getRequiredRevision()) { throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteTable", pkey); } MSSBamTableBySchemaIdxKey keySchemaIdx = schema.getFactoryTable().newSchemaIdxKey(); keySchemaIdx.setRequiredSchemaId(existing.getRequiredSchemaId()); MSSBamTableBySchemaCdIdxKey keySchemaCdIdx = schema.getFactoryTable().newSchemaCdIdxKey(); keySchemaCdIdx.setRequiredSchemaId(existing.getRequiredSchemaId()); keySchemaCdIdx.setRequiredTableClassCode(existing.getRequiredTableClassCode()); MSSBamTableByPrimaryIndexIdxKey keyPrimaryIndexIdx = schema.getFactoryTable().newPrimaryIndexIdxKey(); keyPrimaryIndexIdx.setOptionalPrimaryIndexId(existing.getOptionalPrimaryIndexId()); MSSBamTableBySuperClassDefIdxKey keySuperClassDefIdx = schema.getFactoryTable().newSuperClassDefIdxKey(); keySuperClassDefIdx.setOptionalSuperClassDefId(existing.getOptionalSuperClassDefId()); MSSBamTableByDataScopeIdxKey keyDataScopeIdx = schema.getFactoryTable().newDataScopeIdxKey(); keyDataScopeIdx.setOptionalDataScopeId(existing.getOptionalDataScopeId()); MSSBamTableByVAccSecIdxKey keyVAccSecIdx = schema.getFactoryTable().newVAccSecIdxKey(); keyVAccSecIdx.setOptionalViewAccessSecurityId(existing.getOptionalViewAccessSecurityId()); MSSBamTableByVAccFreqIdxKey keyVAccFreqIdx = schema.getFactoryTable().newVAccFreqIdxKey(); keyVAccFreqIdx.setOptionalViewAccessFrequencyId(existing.getOptionalViewAccessFrequencyId()); MSSBamTableByEAccSecIdxKey keyEAccSecIdx = schema.getFactoryTable().newEAccSecIdxKey(); keyEAccSecIdx.setOptionalEditAccessSecurityId(existing.getOptionalEditAccessSecurityId()); MSSBamTableByEAccFreqIdxKey keyEAccFreqIdx = schema.getFactoryTable().newEAccFreqIdxKey(); keyEAccFreqIdx.setOptionalEditAccessFrequencyId(existing.getOptionalEditAccessFrequencyId()); // Validate reverse foreign keys if (schema.getTableIndex().readDerivedByTableIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteTable", "Container", "Table", "Index", pkey); } if (schema.getTableRelation().readDerivedByFromTblIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteTable", "Container", "FromTable", "Relation", pkey); } if (schema.getTableRelation().readDerivedByToTblIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteTable", "Lookup", "ToTable", "Relation", pkey); } if (schema.getTableChain().readDerivedByTableIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteTable", "Container", "Table", "Chain", pkey); } if (schema.getTableTableBlob().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteTable", "Container", "CTable", "TableBlob", pkey); } if (schema.getTableTableBool().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteTable", "Container", "CTable", "TableBool", pkey); } if (schema.getTableTableDate().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteTable", "Container", "CTable", "TableDate", pkey); } if (schema.getTableTableDouble().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteTable", "Container", "Table", "TableDouble", pkey); } if (schema.getTableTableNumber().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteTable", "Container", "Table", "TableNumber", pkey); } if (schema.getTableTableFloat().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteTable", "Container", "CTable", "TableFloat", pkey); } if (schema.getTableTableInt16().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteTable", "Container", "CTable", "TableInt16", pkey); } if (schema.getTableTableEnum().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteTable", "Container", "CTable", "TableEnum", pkey); } if (schema.getTableTableId16Gen().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteTable", "Container", "CTable", "TableId16Gen", pkey); } if (schema.getTableTableUInt16().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteTable", "Container", "CTable", "TableUInt16", pkey); } if (schema.getTableTableInt32().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteTable", "Container", "CTable", "TableInt32", pkey); } if (schema.getTableTableId32Gen().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteTable", "Container", "CTable", "TableId32Gen", pkey); } if (schema.getTableTableUInt32().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteTable", "Container", "CTable", "TableUInt32", pkey); } if (schema.getTableTableInt64().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteTable", "Container", "CTable", "TableInt64", pkey); } if (schema.getTableTableId64Gen().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteTable", "Container", "CTable", "TableId64Gen", pkey); } if (schema.getTableTableUInt64().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteTable", "Container", "CTable", "TableUInt64", pkey); } if (schema.getTableTableNmToken().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteTable", "Container", "CTable", "TableNmToken", pkey); } if (schema.getTableTableNmTokens().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteTable", "Container", "CTable", "TableNmTokens", pkey); } if (schema.getTableTableString().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteTable", "Container", "CTable", "TableString", pkey); } if (schema.getTableTableTZDate().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteTable", "Container", "CTable", "TableTZDate", pkey); } if (schema.getTableTableTZTime().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteTable", "Container", "CTable", "TableTZTime", pkey); } if (schema.getTableTableTZTimestamp().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteTable", "Container", "CTable", "TableTZTimestamp", pkey); } if (schema.getTableTableText().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteTable", "Container", "CTable", "TableText", pkey); } if (schema.getTableTableTime().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteTable", "Container", "CTable", "TableTime", pkey); } if (schema.getTableTableTimestamp().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteTable", "Container", "CTable", "TableTimestamp", pkey); } if (schema.getTableTableToken().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteTable", "Container", "CTable", "TableToken", pkey); } if (schema.getTableTableUuid().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteTable", "Container", "CTable", "TableUuid", pkey); } if (schema.getTableTableUuidGen().readDerivedByContainerIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteTable", "Container", "CTable", "TableUuidGen", pkey); } if (schema.getTableTableCol().readDerivedByCTableIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteTable", "Container", "CTable", "TableCol", pkey); } // Delete is valid SortedMap<MSSBamAnyObjPKey, MSSBamTableBuff> subdict; dictByPKey.remove(pkey); subdict = dictBySchemaIdx.get(keySchemaIdx); subdict.remove(pkey); dictBySchemaCdIdx.remove(keySchemaCdIdx); subdict = dictByPrimaryIndexIdx.get(keyPrimaryIndexIdx); subdict.remove(pkey); subdict = dictBySuperClassDefIdx.get(keySuperClassDefIdx); 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.MSSBamRamTableTextTable.java
public void updateTableText(MSSBamAuthorization Authorization, MSSBamTableTextBuff Buff) { MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey(); pkey.setRequiredId(Buff.getRequiredId()); MSSBamTableTextBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateTableText", "Existing record not found", "TableText", pkey); }/* w ww . j a v a 2s . c o m*/ MSSBamTableTextByContainerIdxKey existingKeyContainerIdx = schema.getFactoryTableText() .newContainerIdxKey(); existingKeyContainerIdx.setRequiredContainerId(existing.getRequiredContainerId()); MSSBamTableTextByContainerIdxKey newKeyContainerIdx = schema.getFactoryTableText().newContainerIdxKey(); newKeyContainerIdx.setRequiredContainerId(Buff.getRequiredContainerId()); // Check unique indexes // Validate foreign keys { boolean allNull = true; if (allNull) { if (null == schema.getTableTextDef().readDerivedByIdIdx(Authorization, Buff.getRequiredId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateTableText", "Superclass", "SuperClass", "TextDef", null); } } } { boolean allNull = true; if (allNull) { if (null == schema.getTableTable().readDerivedByIdIdx(Authorization, Buff.getRequiredContainerId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateTableText", "Container", "CTable", "Table", null); } } } // Update is valid SortedMap<MSSBamAnyObjPKey, MSSBamTableTextBuff> 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, MSSBamTableTextBuff>(); dictByContainerIdx.put(newKeyContainerIdx, subdict); } subdict.put(pkey, Buff); }
From source file:net.sourceforge.msscodefactory.v1_10.MSSBamRam.MSSBamRamTableTextTable.java
public void deleteTableText(MSSBamAuthorization Authorization, MSSBamTableTextBuff Buff) { final String S_ProcName = "MSSBamRamTableTextTable.deleteTableText() "; MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey(); pkey.setRequiredId(schema.nextAnyObjIdGen()); MSSBamTableTextBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "deleteTableText", "Existing record not found", "TableText", pkey); }// ww w .jav a2 s .c o m if (existing.getRequiredRevision() != Buff.getRequiredRevision()) { throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteTableText", pkey); } MSSBamTableTextByContainerIdxKey keyContainerIdx = schema.getFactoryTableText().newContainerIdxKey(); keyContainerIdx.setRequiredContainerId(existing.getRequiredContainerId()); // Validate reverse foreign keys // Delete is valid SortedMap<MSSBamAnyObjPKey, MSSBamTableTextBuff> subdict; dictByPKey.remove(pkey); subdict = dictByContainerIdx.get(keyContainerIdx); subdict.remove(pkey); }
From source file:net.sourceforge.msscodefactory.v1_10.MSSBamRam.MSSBamRamTableTimestampTable.java
public void updateTableTimestamp(MSSBamAuthorization Authorization, MSSBamTableTimestampBuff Buff) { MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey(); pkey.setRequiredId(Buff.getRequiredId()); MSSBamTableTimestampBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateTableTimestamp", "Existing record not found", "TableTimestamp", pkey); }/*from www . j a v a 2 s . c om*/ MSSBamTableTimestampByContainerIdxKey existingKeyContainerIdx = schema.getFactoryTableTimestamp() .newContainerIdxKey(); existingKeyContainerIdx.setRequiredContainerId(existing.getRequiredContainerId()); MSSBamTableTimestampByContainerIdxKey newKeyContainerIdx = schema.getFactoryTableTimestamp() .newContainerIdxKey(); newKeyContainerIdx.setRequiredContainerId(Buff.getRequiredContainerId()); // Check unique indexes // Validate foreign keys { boolean allNull = true; if (allNull) { if (null == schema.getTableTimestampDef().readDerivedByIdIdx(Authorization, Buff.getRequiredId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateTableTimestamp", "Superclass", "SuperClass", "TimestampDef", null); } } } { boolean allNull = true; if (allNull) { if (null == schema.getTableTable().readDerivedByIdIdx(Authorization, Buff.getRequiredContainerId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateTableTimestamp", "Container", "CTable", "Table", null); } } } // Update is valid SortedMap<MSSBamAnyObjPKey, MSSBamTableTimestampBuff> 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, MSSBamTableTimestampBuff>(); dictByContainerIdx.put(newKeyContainerIdx, subdict); } subdict.put(pkey, Buff); }
From source file:net.sourceforge.msscodefactory.v1_10.MSSBamRam.MSSBamRamTableTimestampTable.java
public void deleteTableTimestamp(MSSBamAuthorization Authorization, MSSBamTableTimestampBuff Buff) { final String S_ProcName = "MSSBamRamTableTimestampTable.deleteTableTimestamp() "; MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey(); pkey.setRequiredId(schema.nextAnyObjIdGen()); MSSBamTableTimestampBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "deleteTableTimestamp", "Existing record not found", "TableTimestamp", pkey); }/* w w w .j ava 2 s .c o m*/ if (existing.getRequiredRevision() != Buff.getRequiredRevision()) { throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteTableTimestamp", pkey); } MSSBamTableTimestampByContainerIdxKey keyContainerIdx = schema.getFactoryTableTimestamp() .newContainerIdxKey(); keyContainerIdx.setRequiredContainerId(existing.getRequiredContainerId()); // Validate reverse foreign keys // Delete is valid SortedMap<MSSBamAnyObjPKey, MSSBamTableTimestampBuff> subdict; dictByPKey.remove(pkey); subdict = dictByContainerIdx.get(keyContainerIdx); subdict.remove(pkey); }
From source file:net.sourceforge.msscodefactory.v1_10.MSSBamRam.MSSBamRamTableTimeTable.java
public void updateTableTime(MSSBamAuthorization Authorization, MSSBamTableTimeBuff Buff) { MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey(); pkey.setRequiredId(Buff.getRequiredId()); MSSBamTableTimeBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateTableTime", "Existing record not found", "TableTime", pkey); }/* w ww. j a va 2 s .com*/ MSSBamTableTimeByContainerIdxKey existingKeyContainerIdx = schema.getFactoryTableTime() .newContainerIdxKey(); existingKeyContainerIdx.setRequiredContainerId(existing.getRequiredContainerId()); MSSBamTableTimeByContainerIdxKey newKeyContainerIdx = schema.getFactoryTableTime().newContainerIdxKey(); newKeyContainerIdx.setRequiredContainerId(Buff.getRequiredContainerId()); // Check unique indexes // Validate foreign keys { boolean allNull = true; if (allNull) { if (null == schema.getTableTimeDef().readDerivedByIdIdx(Authorization, Buff.getRequiredId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateTableTime", "Superclass", "SuperClass", "TimeDef", null); } } } { boolean allNull = true; if (allNull) { if (null == schema.getTableTable().readDerivedByIdIdx(Authorization, Buff.getRequiredContainerId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateTableTime", "Container", "CTable", "Table", null); } } } // Update is valid SortedMap<MSSBamAnyObjPKey, MSSBamTableTimeBuff> 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, MSSBamTableTimeBuff>(); dictByContainerIdx.put(newKeyContainerIdx, subdict); } subdict.put(pkey, Buff); }