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.cfasterisk.v2_0.CFAstRam.CFAstRamSubProjectTable.java

public void deleteSubProject(CFAstAuthorization Authorization, CFAstSubProjectBuff Buff) {
    final String S_ProcName = "CFAstRamSubProjectTable.deleteSubProject() ";
    CFAstDomainBasePKey pkey = schema.getFactoryDomainBase().newPKey();
    pkey.setRequiredTenantId(Buff.getRequiredTenantId());
    pkey.setRequiredId(Buff.getRequiredId());
    CFAstSubProjectBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        return;/*  ww  w .jav  a 2 s .  c  o m*/
    }
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteSubProject",
                pkey);
    }
    CFAstSubProjectByParentIdxKey keyParentIdx = schema.getFactorySubProject().newParentIdxKey();
    keyParentIdx.setRequiredTenantId(existing.getRequiredTenantId());
    keyParentIdx.setRequiredParentProjectId(existing.getRequiredParentProjectId());

    CFAstSubProjectByNameIdxKey keyNameIdx = schema.getFactorySubProject().newNameIdxKey();
    keyNameIdx.setRequiredTenantId(existing.getRequiredTenantId());
    keyNameIdx.setRequiredParentProjectId(existing.getRequiredParentProjectId());
    keyNameIdx.setRequiredName(existing.getRequiredName());

    // Validate reverse foreign keys

    // Delete is valid

    schema.getTableMajorVersion().deleteMajorVersionByPPrjIdx(Authorization, Buff.getRequiredTenantId(),
            Buff.getRequiredId());
    SortedMap<CFAstDomainBasePKey, CFAstSubProjectBuff> subdict;

    dictByPKey.remove(pkey);

    subdict = dictByParentIdx.get(keyParentIdx);
    subdict.remove(pkey);

    dictByNameIdx.remove(keyNameIdx);

    schema.getTableRealProject().deleteRealProject(Authorization, Buff);
}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccRam.CFAccRamTagTable.java

public void updateTag(CFAccAuthorization Authorization, CFAccTagBuff Buff) {
    CFAccTagPKey pkey = schema.getFactoryTag().newPKey();
    pkey.setRequiredTenantId(Buff.getRequiredTenantId());
    pkey.setRequiredId(Buff.getRequiredId());
    CFAccTagBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateTag",
                "Existing record not found", "Tag", pkey);
    }//from   w ww  . ja v a  2 s.  c  o  m
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "updateTag", pkey);
    }
    Buff.setRequiredRevision(Buff.getRequiredRevision() + 1);
    CFAccTagByTenantIdxKey existingKeyTenantIdx = schema.getFactoryTag().newTenantIdxKey();
    existingKeyTenantIdx.setRequiredTenantId(existing.getRequiredTenantId());

    CFAccTagByTenantIdxKey newKeyTenantIdx = schema.getFactoryTag().newTenantIdxKey();
    newKeyTenantIdx.setRequiredTenantId(Buff.getRequiredTenantId());

    CFAccTagByNameIdxKey existingKeyNameIdx = schema.getFactoryTag().newNameIdxKey();
    existingKeyNameIdx.setRequiredTenantId(existing.getRequiredTenantId());
    existingKeyNameIdx.setRequiredName(existing.getRequiredName());

    CFAccTagByNameIdxKey newKeyNameIdx = schema.getFactoryTag().newNameIdxKey();
    newKeyNameIdx.setRequiredTenantId(Buff.getRequiredTenantId());
    newKeyNameIdx.setRequiredName(Buff.getRequiredName());

    // Check unique indexes

    if (!existingKeyNameIdx.equals(newKeyNameIdx)) {
        if (dictByNameIdx.containsKey(newKeyNameIdx)) {
            throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), "updateTag",
                    "TagNameIdx", newKeyNameIdx);
        }
    }

    // Validate foreign keys

    {
        boolean allNull = true;

        if (allNull) {
            if (null == schema.getTableTenant().readDerivedByIdIdx(Authorization, Buff.getRequiredTenantId())) {
                throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateTag",
                        "Container", "TagTenant", "Tenant", null);
            }
        }
    }

    // Update is valid

    SortedMap<CFAccTagPKey, CFAccTagBuff> subdict;

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

    subdict = dictByTenantIdx.get(existingKeyTenantIdx);
    if (subdict != null) {
        subdict.remove(pkey);
    }
    if (dictByTenantIdx.containsKey(newKeyTenantIdx)) {
        subdict = dictByTenantIdx.get(newKeyTenantIdx);
    } else {
        subdict = new TreeMap<CFAccTagPKey, CFAccTagBuff>();
        dictByTenantIdx.put(newKeyTenantIdx, subdict);
    }
    subdict.put(pkey, Buff);

    dictByNameIdx.remove(existingKeyNameIdx);
    dictByNameIdx.put(newKeyNameIdx, Buff);

}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccRam.CFAccRamTopProjectTable.java

public void deleteTopProject(CFAccAuthorization Authorization, CFAccTopProjectBuff Buff) {
    final String S_ProcName = "CFAccRamTopProjectTable.deleteTopProject() ";
    CFAccDomainBasePKey pkey = schema.getFactoryDomainBase().newPKey();
    pkey.setRequiredTenantId(Buff.getRequiredTenantId());
    pkey.setRequiredId(Buff.getRequiredId());
    CFAccTopProjectBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        return;/*from w w w .  j a  v  a  2 s.com*/
    }
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteTopProject",
                pkey);
    }
    CFAccTopProjectByDomainIdxKey keyDomainIdx = schema.getFactoryTopProject().newDomainIdxKey();
    keyDomainIdx.setRequiredTenantId(existing.getRequiredTenantId());
    keyDomainIdx.setRequiredDomainId(existing.getRequiredDomainId());

    CFAccTopProjectByNameIdxKey keyNameIdx = schema.getFactoryTopProject().newNameIdxKey();
    keyNameIdx.setRequiredTenantId(existing.getRequiredTenantId());
    keyNameIdx.setRequiredDomainId(existing.getRequiredDomainId());
    keyNameIdx.setRequiredName(existing.getRequiredName());

    // Validate reverse foreign keys

    // Delete is valid

    schema.getTableSubProject().deleteSubProjectByParentIdx(Authorization, Buff.getRequiredTenantId(),
            Buff.getRequiredId());
    schema.getTableMajorVersion().deleteMajorVersionByPPrjIdx(Authorization, Buff.getRequiredTenantId(),
            Buff.getRequiredId());
    SortedMap<CFAccDomainBasePKey, CFAccTopProjectBuff> subdict;

    dictByPKey.remove(pkey);

    subdict = dictByDomainIdx.get(keyDomainIdx);
    subdict.remove(pkey);

    dictByNameIdx.remove(keyNameIdx);

    schema.getTableRealProject().deleteRealProject(Authorization, Buff);
}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstRam.CFAstRamTopProjectTable.java

public void deleteTopProject(CFAstAuthorization Authorization, CFAstTopProjectBuff Buff) {
    final String S_ProcName = "CFAstRamTopProjectTable.deleteTopProject() ";
    CFAstDomainBasePKey pkey = schema.getFactoryDomainBase().newPKey();
    pkey.setRequiredTenantId(Buff.getRequiredTenantId());
    pkey.setRequiredId(Buff.getRequiredId());
    CFAstTopProjectBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        return;//from  www  . j a  va  2  s  .c o  m
    }
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteTopProject",
                pkey);
    }
    CFAstTopProjectByDomainIdxKey keyDomainIdx = schema.getFactoryTopProject().newDomainIdxKey();
    keyDomainIdx.setRequiredTenantId(existing.getRequiredTenantId());
    keyDomainIdx.setRequiredDomainId(existing.getRequiredDomainId());

    CFAstTopProjectByNameIdxKey keyNameIdx = schema.getFactoryTopProject().newNameIdxKey();
    keyNameIdx.setRequiredTenantId(existing.getRequiredTenantId());
    keyNameIdx.setRequiredDomainId(existing.getRequiredDomainId());
    keyNameIdx.setRequiredName(existing.getRequiredName());

    // Validate reverse foreign keys

    // Delete is valid

    schema.getTableSubProject().deleteSubProjectByParentIdx(Authorization, Buff.getRequiredTenantId(),
            Buff.getRequiredId());
    schema.getTableMajorVersion().deleteMajorVersionByPPrjIdx(Authorization, Buff.getRequiredTenantId(),
            Buff.getRequiredId());
    SortedMap<CFAstDomainBasePKey, CFAstTopProjectBuff> subdict;

    dictByPKey.remove(pkey);

    subdict = dictByDomainIdx.get(keyDomainIdx);
    subdict.remove(pkey);

    dictByNameIdx.remove(keyNameIdx);

    schema.getTableRealProject().deleteRealProject(Authorization, Buff);
}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccRam.CFAccRamSecAppTable.java

public void updateSecApp(CFAccAuthorization Authorization, CFAccSecAppBuff Buff) {
    CFAccSecAppPKey pkey = schema.getFactorySecApp().newPKey();
    pkey.setRequiredClusterId(Buff.getRequiredClusterId());
    pkey.setRequiredSecAppId(Buff.getRequiredSecAppId());
    CFAccSecAppBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateSecApp",
                "Existing record not found", "SecApp", pkey);
    }// ww  w.  j av  a  2  s. com
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "updateSecApp",
                pkey);
    }
    Buff.setRequiredRevision(Buff.getRequiredRevision() + 1);
    CFAccSecAppByClusterIdxKey existingKeyClusterIdx = schema.getFactorySecApp().newClusterIdxKey();
    existingKeyClusterIdx.setRequiredClusterId(existing.getRequiredClusterId());

    CFAccSecAppByClusterIdxKey newKeyClusterIdx = schema.getFactorySecApp().newClusterIdxKey();
    newKeyClusterIdx.setRequiredClusterId(Buff.getRequiredClusterId());

    CFAccSecAppByUJEEMountIdxKey existingKeyUJEEMountIdx = schema.getFactorySecApp().newUJEEMountIdxKey();
    existingKeyUJEEMountIdx.setRequiredClusterId(existing.getRequiredClusterId());
    existingKeyUJEEMountIdx.setRequiredJEEMountName(existing.getRequiredJEEMountName());

    CFAccSecAppByUJEEMountIdxKey newKeyUJEEMountIdx = schema.getFactorySecApp().newUJEEMountIdxKey();
    newKeyUJEEMountIdx.setRequiredClusterId(Buff.getRequiredClusterId());
    newKeyUJEEMountIdx.setRequiredJEEMountName(Buff.getRequiredJEEMountName());

    // Check unique indexes

    if (!existingKeyUJEEMountIdx.equals(newKeyUJEEMountIdx)) {
        if (dictByUJEEMountIdx.containsKey(newKeyUJEEMountIdx)) {
            throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(),
                    "updateSecApp", "SecAppUJEEMountIdx", newKeyUJEEMountIdx);
        }
    }

    // Validate foreign keys

    {
        boolean allNull = true;

        if (allNull) {
            if (null == schema.getTableCluster().readDerivedByIdIdx(Authorization,
                    Buff.getRequiredClusterId())) {
                throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                        "updateSecApp", "Container", "SecAppCluster", "Cluster", null);
            }
        }
    }

    // Update is valid

    SortedMap<CFAccSecAppPKey, CFAccSecAppBuff> subdict;

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

    subdict = dictByClusterIdx.get(existingKeyClusterIdx);
    if (subdict != null) {
        subdict.remove(pkey);
    }
    if (dictByClusterIdx.containsKey(newKeyClusterIdx)) {
        subdict = dictByClusterIdx.get(newKeyClusterIdx);
    } else {
        subdict = new TreeMap<CFAccSecAppPKey, CFAccSecAppBuff>();
        dictByClusterIdx.put(newKeyClusterIdx, subdict);
    }
    subdict.put(pkey, Buff);

    dictByUJEEMountIdx.remove(existingKeyUJEEMountIdx);
    dictByUJEEMountIdx.put(newKeyUJEEMountIdx, Buff);

}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstRam.CFAstRamSecAppTable.java

public void updateSecApp(CFAstAuthorization Authorization, CFAstSecAppBuff Buff) {
    CFAstSecAppPKey pkey = schema.getFactorySecApp().newPKey();
    pkey.setRequiredClusterId(Buff.getRequiredClusterId());
    pkey.setRequiredSecAppId(Buff.getRequiredSecAppId());
    CFAstSecAppBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateSecApp",
                "Existing record not found", "SecApp", pkey);
    }//  ww  w. jav a  2s  . c  om
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "updateSecApp",
                pkey);
    }
    Buff.setRequiredRevision(Buff.getRequiredRevision() + 1);
    CFAstSecAppByClusterIdxKey existingKeyClusterIdx = schema.getFactorySecApp().newClusterIdxKey();
    existingKeyClusterIdx.setRequiredClusterId(existing.getRequiredClusterId());

    CFAstSecAppByClusterIdxKey newKeyClusterIdx = schema.getFactorySecApp().newClusterIdxKey();
    newKeyClusterIdx.setRequiredClusterId(Buff.getRequiredClusterId());

    CFAstSecAppByUJEEMountIdxKey existingKeyUJEEMountIdx = schema.getFactorySecApp().newUJEEMountIdxKey();
    existingKeyUJEEMountIdx.setRequiredClusterId(existing.getRequiredClusterId());
    existingKeyUJEEMountIdx.setRequiredJEEMountName(existing.getRequiredJEEMountName());

    CFAstSecAppByUJEEMountIdxKey newKeyUJEEMountIdx = schema.getFactorySecApp().newUJEEMountIdxKey();
    newKeyUJEEMountIdx.setRequiredClusterId(Buff.getRequiredClusterId());
    newKeyUJEEMountIdx.setRequiredJEEMountName(Buff.getRequiredJEEMountName());

    // Check unique indexes

    if (!existingKeyUJEEMountIdx.equals(newKeyUJEEMountIdx)) {
        if (dictByUJEEMountIdx.containsKey(newKeyUJEEMountIdx)) {
            throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(),
                    "updateSecApp", "SecAppUJEEMountIdx", newKeyUJEEMountIdx);
        }
    }

    // Validate foreign keys

    {
        boolean allNull = true;

        if (allNull) {
            if (null == schema.getTableCluster().readDerivedByIdIdx(Authorization,
                    Buff.getRequiredClusterId())) {
                throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                        "updateSecApp", "Container", "SecAppCluster", "Cluster", null);
            }
        }
    }

    // Update is valid

    SortedMap<CFAstSecAppPKey, CFAstSecAppBuff> subdict;

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

    subdict = dictByClusterIdx.get(existingKeyClusterIdx);
    if (subdict != null) {
        subdict.remove(pkey);
    }
    if (dictByClusterIdx.containsKey(newKeyClusterIdx)) {
        subdict = dictByClusterIdx.get(newKeyClusterIdx);
    } else {
        subdict = new TreeMap<CFAstSecAppPKey, CFAstSecAppBuff>();
        dictByClusterIdx.put(newKeyClusterIdx, subdict);
    }
    subdict.put(pkey, Buff);

    dictByUJEEMountIdx.remove(existingKeyUJEEMountIdx);
    dictByUJEEMountIdx.put(newKeyUJEEMountIdx, Buff);

}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccRam.CFAccRamTSecGroupTable.java

public void updateTSecGroup(CFAccAuthorization Authorization, CFAccTSecGroupBuff Buff) {
    CFAccTSecGroupPKey pkey = schema.getFactoryTSecGroup().newPKey();
    pkey.setRequiredTenantId(Buff.getRequiredTenantId());
    pkey.setRequiredTSecGroupId(Buff.getRequiredTSecGroupId());
    CFAccTSecGroupBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateTSecGroup",
                "Existing record not found", "TSecGroup", pkey);
    }/*  w  w  w . j a  v a2 s.  co m*/
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "updateTSecGroup",
                pkey);
    }
    Buff.setRequiredRevision(Buff.getRequiredRevision() + 1);
    CFAccTSecGroupByTenantIdxKey existingKeyTenantIdx = schema.getFactoryTSecGroup().newTenantIdxKey();
    existingKeyTenantIdx.setRequiredTenantId(existing.getRequiredTenantId());

    CFAccTSecGroupByTenantIdxKey newKeyTenantIdx = schema.getFactoryTSecGroup().newTenantIdxKey();
    newKeyTenantIdx.setRequiredTenantId(Buff.getRequiredTenantId());

    CFAccTSecGroupByUNameIdxKey existingKeyUNameIdx = schema.getFactoryTSecGroup().newUNameIdxKey();
    existingKeyUNameIdx.setRequiredTenantId(existing.getRequiredTenantId());
    existingKeyUNameIdx.setRequiredName(existing.getRequiredName());

    CFAccTSecGroupByUNameIdxKey newKeyUNameIdx = schema.getFactoryTSecGroup().newUNameIdxKey();
    newKeyUNameIdx.setRequiredTenantId(Buff.getRequiredTenantId());
    newKeyUNameIdx.setRequiredName(Buff.getRequiredName());

    // Check unique indexes

    if (!existingKeyUNameIdx.equals(newKeyUNameIdx)) {
        if (dictByUNameIdx.containsKey(newKeyUNameIdx)) {
            throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(),
                    "updateTSecGroup", "TSecGroupUNameIdx", newKeyUNameIdx);
        }
    }

    // Validate foreign keys

    {
        boolean allNull = true;

        if (allNull) {
            if (null == schema.getTableTenant().readDerivedByIdIdx(Authorization, Buff.getRequiredTenantId())) {
                throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                        "updateTSecGroup", "Container", "TSecGroupTenant", "Tenant", null);
            }
        }
    }

    // Update is valid

    SortedMap<CFAccTSecGroupPKey, CFAccTSecGroupBuff> subdict;

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

    subdict = dictByTenantIdx.get(existingKeyTenantIdx);
    if (subdict != null) {
        subdict.remove(pkey);
    }
    if (dictByTenantIdx.containsKey(newKeyTenantIdx)) {
        subdict = dictByTenantIdx.get(newKeyTenantIdx);
    } else {
        subdict = new TreeMap<CFAccTSecGroupPKey, CFAccTSecGroupBuff>();
        dictByTenantIdx.put(newKeyTenantIdx, subdict);
    }
    subdict.put(pkey, Buff);

    dictByUNameIdx.remove(existingKeyUNameIdx);
    dictByUNameIdx.put(newKeyUNameIdx, Buff);

}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstRam.CFAstRamTSecGroupTable.java

public void updateTSecGroup(CFAstAuthorization Authorization, CFAstTSecGroupBuff Buff) {
    CFAstTSecGroupPKey pkey = schema.getFactoryTSecGroup().newPKey();
    pkey.setRequiredTenantId(Buff.getRequiredTenantId());
    pkey.setRequiredTSecGroupId(Buff.getRequiredTSecGroupId());
    CFAstTSecGroupBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateTSecGroup",
                "Existing record not found", "TSecGroup", pkey);
    }//  w w w  . j a v  a  2 s.  c  o m
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "updateTSecGroup",
                pkey);
    }
    Buff.setRequiredRevision(Buff.getRequiredRevision() + 1);
    CFAstTSecGroupByTenantIdxKey existingKeyTenantIdx = schema.getFactoryTSecGroup().newTenantIdxKey();
    existingKeyTenantIdx.setRequiredTenantId(existing.getRequiredTenantId());

    CFAstTSecGroupByTenantIdxKey newKeyTenantIdx = schema.getFactoryTSecGroup().newTenantIdxKey();
    newKeyTenantIdx.setRequiredTenantId(Buff.getRequiredTenantId());

    CFAstTSecGroupByUNameIdxKey existingKeyUNameIdx = schema.getFactoryTSecGroup().newUNameIdxKey();
    existingKeyUNameIdx.setRequiredTenantId(existing.getRequiredTenantId());
    existingKeyUNameIdx.setRequiredName(existing.getRequiredName());

    CFAstTSecGroupByUNameIdxKey newKeyUNameIdx = schema.getFactoryTSecGroup().newUNameIdxKey();
    newKeyUNameIdx.setRequiredTenantId(Buff.getRequiredTenantId());
    newKeyUNameIdx.setRequiredName(Buff.getRequiredName());

    // Check unique indexes

    if (!existingKeyUNameIdx.equals(newKeyUNameIdx)) {
        if (dictByUNameIdx.containsKey(newKeyUNameIdx)) {
            throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(),
                    "updateTSecGroup", "TSecGroupUNameIdx", newKeyUNameIdx);
        }
    }

    // Validate foreign keys

    {
        boolean allNull = true;

        if (allNull) {
            if (null == schema.getTableTenant().readDerivedByIdIdx(Authorization, Buff.getRequiredTenantId())) {
                throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                        "updateTSecGroup", "Container", "TSecGroupTenant", "Tenant", null);
            }
        }
    }

    // Update is valid

    SortedMap<CFAstTSecGroupPKey, CFAstTSecGroupBuff> subdict;

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

    subdict = dictByTenantIdx.get(existingKeyTenantIdx);
    if (subdict != null) {
        subdict.remove(pkey);
    }
    if (dictByTenantIdx.containsKey(newKeyTenantIdx)) {
        subdict = dictByTenantIdx.get(newKeyTenantIdx);
    } else {
        subdict = new TreeMap<CFAstTSecGroupPKey, CFAstTSecGroupBuff>();
        dictByTenantIdx.put(newKeyTenantIdx, subdict);
    }
    subdict.put(pkey, Buff);

    dictByUNameIdx.remove(existingKeyUNameIdx);
    dictByUNameIdx.put(newKeyUNameIdx, Buff);

}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccRam.CFAccRamSecSessionTable.java

public void deleteSecSession(CFAccAuthorization Authorization, CFAccSecSessionBuff Buff) {
    final String S_ProcName = "CFAccRamSecSessionTable.deleteSecSession() ";
    CFAccSecSessionPKey pkey = schema.getFactorySecSession().newPKey();
    pkey.setRequiredSecSessionId(Buff.getRequiredSecSessionId());
    CFAccSecSessionBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        return;//from  w ww  .ja  v a 2 s. c o m
    }
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteSecSession",
                pkey);
    }
    CFAccSecSessionBySecUserIdxKey keySecUserIdx = schema.getFactorySecSession().newSecUserIdxKey();
    keySecUserIdx.setRequiredSecUserId(existing.getRequiredSecUserId());

    CFAccSecSessionByStartIdxKey keyStartIdx = schema.getFactorySecSession().newStartIdxKey();
    keyStartIdx.setRequiredSecUserId(existing.getRequiredSecUserId());
    keyStartIdx.setRequiredStart(existing.getRequiredStart());

    CFAccSecSessionByFinishIdxKey keyFinishIdx = schema.getFactorySecSession().newFinishIdxKey();
    keyFinishIdx.setRequiredSecUserId(existing.getRequiredSecUserId());
    keyFinishIdx.setOptionalFinish(existing.getOptionalFinish());

    // Validate reverse foreign keys

    // Delete is valid

    SortedMap<CFAccSecSessionPKey, CFAccSecSessionBuff> subdict;

    dictByPKey.remove(pkey);

    subdict = dictBySecUserIdx.get(keySecUserIdx);
    subdict.remove(pkey);

    dictByStartIdx.remove(keyStartIdx);

    subdict = dictByFinishIdx.get(keyFinishIdx);
    subdict.remove(pkey);

}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstRam.CFAstRamSecSessionTable.java

public void deleteSecSession(CFAstAuthorization Authorization, CFAstSecSessionBuff Buff) {
    final String S_ProcName = "CFAstRamSecSessionTable.deleteSecSession() ";
    CFAstSecSessionPKey pkey = schema.getFactorySecSession().newPKey();
    pkey.setRequiredSecSessionId(Buff.getRequiredSecSessionId());
    CFAstSecSessionBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        return;//w w w . ja  v a  2s.co  m
    }
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteSecSession",
                pkey);
    }
    CFAstSecSessionBySecUserIdxKey keySecUserIdx = schema.getFactorySecSession().newSecUserIdxKey();
    keySecUserIdx.setRequiredSecUserId(existing.getRequiredSecUserId());

    CFAstSecSessionByStartIdxKey keyStartIdx = schema.getFactorySecSession().newStartIdxKey();
    keyStartIdx.setRequiredSecUserId(existing.getRequiredSecUserId());
    keyStartIdx.setRequiredStart(existing.getRequiredStart());

    CFAstSecSessionByFinishIdxKey keyFinishIdx = schema.getFactorySecSession().newFinishIdxKey();
    keyFinishIdx.setRequiredSecUserId(existing.getRequiredSecUserId());
    keyFinishIdx.setOptionalFinish(existing.getOptionalFinish());

    // Validate reverse foreign keys

    // Delete is valid

    SortedMap<CFAstSecSessionPKey, CFAstSecSessionBuff> subdict;

    dictByPKey.remove(pkey);

    subdict = dictBySecUserIdx.get(keySecUserIdx);
    subdict.remove(pkey);

    dictByStartIdx.remove(keyStartIdx);

    subdict = dictByFinishIdx.get(keyFinishIdx);
    subdict.remove(pkey);

}