Example usage for java.util SortedMap remove

List of usage examples for java.util SortedMap remove

Introduction

In this page you can find the example usage for java.util SortedMap remove.

Prototype

V remove(Object key);

Source Link

Document

Removes the mapping for a key from this map if it is present (optional operation).

Usage

From source file:net.sourceforge.msscodefactory.v1_11.MSSBamRam.MSSBamRamClearSubDep2Table.java

public void deleteClearSubDep2(MSSBamAuthorization Authorization, MSSBamClearSubDep2Buff Buff) {
    final String S_ProcName = "MSSBamRamClearSubDep2Table.deleteClearSubDep2() ";
    MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey();

    pkey.setRequiredId(schema.nextAnyObjIdGen());
    MSSBamClearSubDep2Buff existing = dictByPKey.get(pkey);
    if (existing == null) {
        throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(),
                "deleteClearSubDep2", "Existing record not found", "ClearSubDep2", pkey);
    }//from   w  ww  .ja  va  2 s  . co m
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteClearSubDep2",
                pkey);
    }
    MSSBamClearSubDep2ByContClearDep1IdxKey keyContClearDep1Idx = schema.getFactoryClearSubDep2()
            .newContClearDep1IdxKey();
    keyContClearDep1Idx.setRequiredContClearDep1Id(existing.getRequiredContClearDep1Id());

    // Validate reverse foreign keys

    if (schema.getTableClearSubDep3().readDerivedByContClearDep2Idx(Authorization,
            existing.getRequiredId()).length > 0) {
        throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(),
                "deleteClearSubDep2", "Container", "ContClearSubDep3", "ClearSubDep3", pkey);
    }

    // Delete is valid

    SortedMap<MSSBamAnyObjPKey, MSSBamClearSubDep2Buff> subdict;

    dictByPKey.remove(pkey);

    subdict = dictByContClearDep1Idx.get(keyContClearDep1Idx);
    subdict.remove(pkey);

}

From source file:net.sourceforge.msscodefactory.v1_11.MSSBamRam.MSSBamRamClearSubDep3Table.java

public void updateClearSubDep3(MSSBamAuthorization Authorization, MSSBamClearSubDep3Buff Buff) {
    MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey();
    pkey.setRequiredId(Buff.getRequiredId());
    MSSBamClearSubDep3Buff existing = dictByPKey.get(pkey);
    if (existing == null) {
        throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(),
                "updateClearSubDep3", "Existing record not found", "ClearSubDep3", pkey);
    }/*from   ww  w .  java  2 s . c  o m*/
    MSSBamClearSubDep3ByContClearDep2IdxKey existingKeyContClearDep2Idx = schema.getFactoryClearSubDep3()
            .newContClearDep2IdxKey();
    existingKeyContClearDep2Idx.setRequiredContClearDep2Id(existing.getRequiredContClearDep2Id());

    MSSBamClearSubDep3ByContClearDep2IdxKey newKeyContClearDep2Idx = schema.getFactoryClearSubDep3()
            .newContClearDep2IdxKey();
    newKeyContClearDep2Idx.setRequiredContClearDep2Id(Buff.getRequiredContClearDep2Id());

    // Check unique indexes

    // Validate foreign keys

    {
        boolean allNull = true;

        if (allNull) {
            if (null == schema.getTableClearDep().readDerivedByIdIdx(Authorization, Buff.getRequiredId())) {
                throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                        "updateClearSubDep3", "Superclass", "SuperClass", "ClearDep", null);
            }
        }
    }

    {
        boolean allNull = true;

        if (allNull) {
            if (null == schema.getTableClearSubDep2().readDerivedByIdIdx(Authorization,
                    Buff.getRequiredContClearDep2Id())) {
                throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                        "updateClearSubDep3", "Container", "ContClearSubDep3", "ClearSubDep2", null);
            }
        }
    }

    // Update is valid

    SortedMap<MSSBamAnyObjPKey, MSSBamClearSubDep3Buff> subdict;

    dictByPKey.remove(pkey);
    dictByPKey.put(pkey, Buff);

    subdict = dictByContClearDep2Idx.get(existingKeyContClearDep2Idx);
    if (subdict != null) {
        subdict.remove(pkey);
    }
    if (dictByContClearDep2Idx.containsKey(newKeyContClearDep2Idx)) {
        subdict = dictByContClearDep2Idx.get(newKeyContClearDep2Idx);
    } else {
        subdict = new TreeMap<MSSBamAnyObjPKey, MSSBamClearSubDep3Buff>();
        dictByContClearDep2Idx.put(newKeyContClearDep2Idx, subdict);
    }
    subdict.put(pkey, Buff);

}

From source file:net.sourceforge.msscodefactory.v1_11.MSSBamRam.MSSBamRamClearSubDep3Table.java

public void deleteClearSubDep3(MSSBamAuthorization Authorization, MSSBamClearSubDep3Buff Buff) {
    final String S_ProcName = "MSSBamRamClearSubDep3Table.deleteClearSubDep3() ";
    MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey();

    pkey.setRequiredId(schema.nextAnyObjIdGen());
    MSSBamClearSubDep3Buff existing = dictByPKey.get(pkey);
    if (existing == null) {
        throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(),
                "deleteClearSubDep3", "Existing record not found", "ClearSubDep3", pkey);
    }// ww  w . j  av  a 2 s.c  o  m
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteClearSubDep3",
                pkey);
    }
    MSSBamClearSubDep3ByContClearDep2IdxKey keyContClearDep2Idx = schema.getFactoryClearSubDep3()
            .newContClearDep2IdxKey();
    keyContClearDep2Idx.setRequiredContClearDep2Id(existing.getRequiredContClearDep2Id());

    // Validate reverse foreign keys

    // Delete is valid

    SortedMap<MSSBamAnyObjPKey, MSSBamClearSubDep3Buff> subdict;

    dictByPKey.remove(pkey);

    subdict = dictByContClearDep2Idx.get(keyContClearDep2Idx);
    subdict.remove(pkey);

}

From source file:net.sourceforge.msscodefactory.v1_11.MSSBamRam.MSSBamRamClearTopDepTable.java

public void updateClearTopDep(MSSBamAuthorization Authorization, MSSBamClearTopDepBuff Buff) {
    MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey();
    pkey.setRequiredId(Buff.getRequiredId());
    MSSBamClearTopDepBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateClearTopDep",
                "Existing record not found", "ClearTopDep", pkey);
    }/*ww  w  .  j  a v a  2s . c  o m*/
    MSSBamClearTopDepByContTblIdxKey existingKeyContTblIdx = schema.getFactoryClearTopDep().newContTblIdxKey();
    existingKeyContTblIdx.setRequiredContTableId(existing.getRequiredContTableId());

    MSSBamClearTopDepByContTblIdxKey newKeyContTblIdx = schema.getFactoryClearTopDep().newContTblIdxKey();
    newKeyContTblIdx.setRequiredContTableId(Buff.getRequiredContTableId());

    // Check unique indexes

    // Validate foreign keys

    {
        boolean allNull = true;

        if (allNull) {
            if (null == schema.getTableClearDep().readDerivedByIdIdx(Authorization, Buff.getRequiredId())) {
                throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                        "updateClearTopDep", "Superclass", "SuperClass", "ClearDep", null);
            }
        }
    }

    {
        boolean allNull = true;

        if (allNull) {
            if (null == schema.getTableTable().readDerivedByIdIdx(Authorization,
                    Buff.getRequiredContTableId())) {
                throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                        "updateClearTopDep", "Container", "ContTable", "Table", null);
            }
        }
    }

    // Update is valid

    SortedMap<MSSBamAnyObjPKey, MSSBamClearTopDepBuff> 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, MSSBamClearTopDepBuff>();
        dictByContTblIdx.put(newKeyContTblIdx, subdict);
    }
    subdict.put(pkey, Buff);

}

From source file:net.sourceforge.msscodefactory.v1_11.MSSBamRam.MSSBamRamClearTopDepTable.java

public void deleteClearTopDep(MSSBamAuthorization Authorization, MSSBamClearTopDepBuff Buff) {
    final String S_ProcName = "MSSBamRamClearTopDepTable.deleteClearTopDep() ";
    MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey();

    pkey.setRequiredId(schema.nextAnyObjIdGen());
    MSSBamClearTopDepBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "deleteClearTopDep",
                "Existing record not found", "ClearTopDep", pkey);
    }//from   www  . ja v  a2 s . c o m
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteClearTopDep",
                pkey);
    }
    MSSBamClearTopDepByContTblIdxKey keyContTblIdx = schema.getFactoryClearTopDep().newContTblIdxKey();
    keyContTblIdx.setRequiredContTableId(existing.getRequiredContTableId());

    // Validate reverse foreign keys

    if (schema.getTableClearSubDep1().readDerivedByContClearTopIdx(Authorization,
            existing.getRequiredId()).length > 0) {
        throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteClearTopDep",
                "Container", "ContClearTopDep", "ClearSubDep1", pkey);
    }

    // Delete is valid

    SortedMap<MSSBamAnyObjPKey, MSSBamClearTopDepBuff> subdict;

    dictByPKey.remove(pkey);

    subdict = dictByContTblIdx.get(keyContTblIdx);
    subdict.remove(pkey);

}

From source file:net.sourceforge.msscodefactory.v1_11.MSSBamRam.MSSBamRamDelDepTable.java

public void updateDelDep(MSSBamAuthorization Authorization, MSSBamDelDepBuff Buff) {
    MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey();
    pkey.setRequiredId(Buff.getRequiredId());
    MSSBamDelDepBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateDelDep",
                "Existing record not found", "DelDep", pkey);
    }// ww w .java 2 s  . co m
    MSSBamDelDepByTableIdxKey existingKeyTableIdx = schema.getFactoryDelDep().newTableIdxKey();
    existingKeyTableIdx.setRequiredRelationId(existing.getRequiredRelationId());

    MSSBamDelDepByTableIdxKey newKeyTableIdx = schema.getFactoryDelDep().newTableIdxKey();
    newKeyTableIdx.setRequiredRelationId(Buff.getRequiredRelationId());

    // Check unique indexes

    // Validate foreign keys

    {
        boolean allNull = true;

        if (allNull) {
            if (null == schema.getTableScope().readDerivedByIdIdx(Authorization, Buff.getRequiredId())) {
                throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                        "updateDelDep", "Superclass", "SuperClass", "Scope", null);
            }
        }
    }

    {
        boolean allNull = true;

        if (allNull) {
            if (null == schema.getTableRelation().readDerivedByIdIdx(Authorization,
                    Buff.getRequiredRelationId())) {
                throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                        "updateDelDep", "Lookup", "Relation", "Relation", null);
            }
        }
    }

    // Update is valid

    SortedMap<MSSBamAnyObjPKey, MSSBamDelDepBuff> subdict;

    dictByPKey.remove(pkey);
    dictByPKey.put(pkey, Buff);

    subdict = dictByTableIdx.get(existingKeyTableIdx);
    if (subdict != null) {
        subdict.remove(pkey);
    }
    if (dictByTableIdx.containsKey(newKeyTableIdx)) {
        subdict = dictByTableIdx.get(newKeyTableIdx);
    } else {
        subdict = new TreeMap<MSSBamAnyObjPKey, MSSBamDelDepBuff>();
        dictByTableIdx.put(newKeyTableIdx, subdict);
    }
    subdict.put(pkey, Buff);

}

From source file:net.sourceforge.msscodefactory.v1_11.MSSBamRam.MSSBamRamDelDepTable.java

public void deleteDelDep(MSSBamAuthorization Authorization, MSSBamDelDepBuff Buff) {
    final String S_ProcName = "MSSBamRamDelDepTable.deleteDelDep() ";
    MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey();

    pkey.setRequiredId(schema.nextAnyObjIdGen());
    MSSBamDelDepBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "deleteDelDep",
                "Existing record not found", "DelDep", pkey);
    }/*from   w  w w  .ja v a2  s.c o m*/
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteDelDep",
                pkey);
    }
    MSSBamDelDepByTableIdxKey keyTableIdx = schema.getFactoryDelDep().newTableIdxKey();
    keyTableIdx.setRequiredRelationId(existing.getRequiredRelationId());

    // Validate reverse foreign keys

    if (schema.getTableDelTopDep().readDerivedByIdIdx(Authorization, existing.getRequiredId()) != null) {
        throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteDelDep",
                "Superclass", "SuperClass", "DelTopDep", pkey);
    }

    if (schema.getTableDelSubDep1().readDerivedByIdIdx(Authorization, existing.getRequiredId()) != null) {
        throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteDelDep",
                "Superclass", "SuperClass", "DelSubDep1", pkey);
    }

    if (schema.getTableDelSubDep2().readDerivedByIdIdx(Authorization, existing.getRequiredId()) != null) {
        throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteDelDep",
                "Superclass", "SuperClass", "DelSubDep2", pkey);
    }

    if (schema.getTableDelSubDep3().readDerivedByIdIdx(Authorization, existing.getRequiredId()) != null) {
        throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteDelDep",
                "Superclass", "SuperClass", "DelSubDep3", pkey);
    }

    // Delete is valid

    SortedMap<MSSBamAnyObjPKey, MSSBamDelDepBuff> subdict;

    dictByPKey.remove(pkey);

    subdict = dictByTableIdx.get(keyTableIdx);
    subdict.remove(pkey);

}

From source file:net.sourceforge.msscodefactory.v1_11.MSSBamRam.MSSBamRamDelSubDep1Table.java

public void updateDelSubDep1(MSSBamAuthorization Authorization, MSSBamDelSubDep1Buff Buff) {
    MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey();
    pkey.setRequiredId(Buff.getRequiredId());
    MSSBamDelSubDep1Buff existing = dictByPKey.get(pkey);
    if (existing == null) {
        throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateDelSubDep1",
                "Existing record not found", "DelSubDep1", pkey);
    }/*ww w .  ja v a 2s. co m*/
    MSSBamDelSubDep1ByContDelTopIdxKey existingKeyContDelTopIdx = schema.getFactoryDelSubDep1()
            .newContDelTopIdxKey();
    existingKeyContDelTopIdx.setRequiredContDelTopDepId(existing.getRequiredContDelTopDepId());

    MSSBamDelSubDep1ByContDelTopIdxKey newKeyContDelTopIdx = schema.getFactoryDelSubDep1()
            .newContDelTopIdxKey();
    newKeyContDelTopIdx.setRequiredContDelTopDepId(Buff.getRequiredContDelTopDepId());

    // Check unique indexes

    // Validate foreign keys

    {
        boolean allNull = true;

        if (allNull) {
            if (null == schema.getTableDelDep().readDerivedByIdIdx(Authorization, Buff.getRequiredId())) {
                throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                        "updateDelSubDep1", "Superclass", "SuperClass", "DelDep", null);
            }
        }
    }

    {
        boolean allNull = true;

        if (allNull) {
            if (null == schema.getTableDelTopDep().readDerivedByIdIdx(Authorization,
                    Buff.getRequiredContDelTopDepId())) {
                throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                        "updateDelSubDep1", "Container", "ContDelTopDep", "DelTopDep", null);
            }
        }
    }

    // Update is valid

    SortedMap<MSSBamAnyObjPKey, MSSBamDelSubDep1Buff> subdict;

    dictByPKey.remove(pkey);
    dictByPKey.put(pkey, Buff);

    subdict = dictByContDelTopIdx.get(existingKeyContDelTopIdx);
    if (subdict != null) {
        subdict.remove(pkey);
    }
    if (dictByContDelTopIdx.containsKey(newKeyContDelTopIdx)) {
        subdict = dictByContDelTopIdx.get(newKeyContDelTopIdx);
    } else {
        subdict = new TreeMap<MSSBamAnyObjPKey, MSSBamDelSubDep1Buff>();
        dictByContDelTopIdx.put(newKeyContDelTopIdx, subdict);
    }
    subdict.put(pkey, Buff);

}

From source file:net.sourceforge.msscodefactory.v1_11.MSSBamRam.MSSBamRamDelSubDep1Table.java

public void deleteDelSubDep1(MSSBamAuthorization Authorization, MSSBamDelSubDep1Buff Buff) {
    final String S_ProcName = "MSSBamRamDelSubDep1Table.deleteDelSubDep1() ";
    MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey();

    pkey.setRequiredId(schema.nextAnyObjIdGen());
    MSSBamDelSubDep1Buff existing = dictByPKey.get(pkey);
    if (existing == null) {
        throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "deleteDelSubDep1",
                "Existing record not found", "DelSubDep1", pkey);
    }/*from   ww w. j  av a  2  s  .  c om*/
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteDelSubDep1",
                pkey);
    }
    MSSBamDelSubDep1ByContDelTopIdxKey keyContDelTopIdx = schema.getFactoryDelSubDep1().newContDelTopIdxKey();
    keyContDelTopIdx.setRequiredContDelTopDepId(existing.getRequiredContDelTopDepId());

    // Validate reverse foreign keys

    if (schema.getTableDelSubDep2().readDerivedByContDelDep1Idx(Authorization,
            existing.getRequiredId()).length > 0) {
        throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteDelSubDep1",
                "Container", "ContDelSubDep1", "DelSubDep2", pkey);
    }

    // Delete is valid

    SortedMap<MSSBamAnyObjPKey, MSSBamDelSubDep1Buff> subdict;

    dictByPKey.remove(pkey);

    subdict = dictByContDelTopIdx.get(keyContDelTopIdx);
    subdict.remove(pkey);

}

From source file:net.sourceforge.msscodefactory.v1_11.MSSBamRam.MSSBamRamDelSubDep2Table.java

public void updateDelSubDep2(MSSBamAuthorization Authorization, MSSBamDelSubDep2Buff Buff) {
    MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey();
    pkey.setRequiredId(Buff.getRequiredId());
    MSSBamDelSubDep2Buff existing = dictByPKey.get(pkey);
    if (existing == null) {
        throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateDelSubDep2",
                "Existing record not found", "DelSubDep2", pkey);
    }//from  w  w  w .  j  a v  a2  s .co m
    MSSBamDelSubDep2ByContDelDep1IdxKey existingKeyContDelDep1Idx = schema.getFactoryDelSubDep2()
            .newContDelDep1IdxKey();
    existingKeyContDelDep1Idx.setRequiredContDelDep1Id(existing.getRequiredContDelDep1Id());

    MSSBamDelSubDep2ByContDelDep1IdxKey newKeyContDelDep1Idx = schema.getFactoryDelSubDep2()
            .newContDelDep1IdxKey();
    newKeyContDelDep1Idx.setRequiredContDelDep1Id(Buff.getRequiredContDelDep1Id());

    // Check unique indexes

    // Validate foreign keys

    {
        boolean allNull = true;

        if (allNull) {
            if (null == schema.getTableDelDep().readDerivedByIdIdx(Authorization, Buff.getRequiredId())) {
                throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                        "updateDelSubDep2", "Superclass", "SuperClass", "DelDep", null);
            }
        }
    }

    {
        boolean allNull = true;

        if (allNull) {
            if (null == schema.getTableDelSubDep1().readDerivedByIdIdx(Authorization,
                    Buff.getRequiredContDelDep1Id())) {
                throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                        "updateDelSubDep2", "Container", "ContDelSubDep1", "DelSubDep1", null);
            }
        }
    }

    // Update is valid

    SortedMap<MSSBamAnyObjPKey, MSSBamDelSubDep2Buff> subdict;

    dictByPKey.remove(pkey);
    dictByPKey.put(pkey, Buff);

    subdict = dictByContDelDep1Idx.get(existingKeyContDelDep1Idx);
    if (subdict != null) {
        subdict.remove(pkey);
    }
    if (dictByContDelDep1Idx.containsKey(newKeyContDelDep1Idx)) {
        subdict = dictByContDelDep1Idx.get(newKeyContDelDep1Idx);
    } else {
        subdict = new TreeMap<MSSBamAnyObjPKey, MSSBamDelSubDep2Buff>();
        dictByContDelDep1Idx.put(newKeyContDelDep1Idx, subdict);
    }
    subdict.put(pkey, Buff);

}