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.cfsecurity.v2_0.CFSecurityRam.CFSecurityRamTenantTable.java

public void deleteTenant(CFSecurityAuthorization Authorization, CFSecurityTenantBuff Buff) {
    final String S_ProcName = "CFSecurityRamTenantTable.deleteTenant() ";
    CFSecurityTenantPKey pkey = schema.getFactoryTenant().newPKey();
    pkey.setRequiredId(Buff.getRequiredId());
    CFSecurityTenantBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        return;//from  w  w  w. j a  v  a 2  s .c om
    }
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteTenant",
                pkey);
    }
    CFSecurityTenantByClusterIdxKey keyClusterIdx = schema.getFactoryTenant().newClusterIdxKey();
    keyClusterIdx.setRequiredClusterId(existing.getRequiredClusterId());

    CFSecurityTenantByUNameIdxKey keyUNameIdx = schema.getFactoryTenant().newUNameIdxKey();
    keyUNameIdx.setRequiredClusterId(existing.getRequiredClusterId());
    keyUNameIdx.setRequiredTenantName(existing.getRequiredTenantName());

    // Validate reverse foreign keys

    // Delete is valid

    schema.getTableTSecGroup().deleteTSecGroupByTenantIdx(Authorization, Buff.getRequiredId());
    SortedMap<CFSecurityTenantPKey, CFSecurityTenantBuff> subdict;

    dictByPKey.remove(pkey);

    subdict = dictByClusterIdx.get(keyClusterIdx);
    subdict.remove(pkey);

    dictByUNameIdx.remove(keyUNameIdx);

}

From source file:net.sourceforge.msscodefactory.cfsecurity.v2_0.CFSecurityRam.CFSecurityRamTSecGroupIncludeTable.java

public void updateTSecGroupInclude(CFSecurityAuthorization Authorization, CFSecurityTSecGroupIncludeBuff Buff) {
    CFSecurityTSecGroupIncludePKey pkey = schema.getFactoryTSecGroupInclude().newPKey();
    pkey.setRequiredTenantId(Buff.getRequiredTenantId());
    pkey.setRequiredTSecGroupIncludeId(Buff.getRequiredTSecGroupIncludeId());
    CFSecurityTSecGroupIncludeBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(),
                "updateTSecGroupInclude", "Existing record not found", "TSecGroupInclude", pkey);
    }//from   w  w  w  .j  a va  2s.c o  m
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(),
                "updateTSecGroupInclude", pkey);
    }
    Buff.setRequiredRevision(Buff.getRequiredRevision() + 1);
    CFSecurityTSecGroupIncludeByTenantIdxKey existingKeyTenantIdx = schema.getFactoryTSecGroupInclude()
            .newTenantIdxKey();
    existingKeyTenantIdx.setRequiredTenantId(existing.getRequiredTenantId());

    CFSecurityTSecGroupIncludeByTenantIdxKey newKeyTenantIdx = schema.getFactoryTSecGroupInclude()
            .newTenantIdxKey();
    newKeyTenantIdx.setRequiredTenantId(Buff.getRequiredTenantId());

    CFSecurityTSecGroupIncludeByGroupIdxKey existingKeyGroupIdx = schema.getFactoryTSecGroupInclude()
            .newGroupIdxKey();
    existingKeyGroupIdx.setRequiredTenantId(existing.getRequiredTenantId());
    existingKeyGroupIdx.setRequiredTSecGroupId(existing.getRequiredTSecGroupId());

    CFSecurityTSecGroupIncludeByGroupIdxKey newKeyGroupIdx = schema.getFactoryTSecGroupInclude()
            .newGroupIdxKey();
    newKeyGroupIdx.setRequiredTenantId(Buff.getRequiredTenantId());
    newKeyGroupIdx.setRequiredTSecGroupId(Buff.getRequiredTSecGroupId());

    CFSecurityTSecGroupIncludeByIncludeIdxKey existingKeyIncludeIdx = schema.getFactoryTSecGroupInclude()
            .newIncludeIdxKey();
    existingKeyIncludeIdx.setRequiredTenantId(existing.getRequiredTenantId());
    existingKeyIncludeIdx.setRequiredIncludeGroupId(existing.getRequiredIncludeGroupId());

    CFSecurityTSecGroupIncludeByIncludeIdxKey newKeyIncludeIdx = schema.getFactoryTSecGroupInclude()
            .newIncludeIdxKey();
    newKeyIncludeIdx.setRequiredTenantId(Buff.getRequiredTenantId());
    newKeyIncludeIdx.setRequiredIncludeGroupId(Buff.getRequiredIncludeGroupId());

    CFSecurityTSecGroupIncludeByUIncludeIdxKey existingKeyUIncludeIdx = schema.getFactoryTSecGroupInclude()
            .newUIncludeIdxKey();
    existingKeyUIncludeIdx.setRequiredTenantId(existing.getRequiredTenantId());
    existingKeyUIncludeIdx.setRequiredTSecGroupId(existing.getRequiredTSecGroupId());
    existingKeyUIncludeIdx.setRequiredIncludeGroupId(existing.getRequiredIncludeGroupId());

    CFSecurityTSecGroupIncludeByUIncludeIdxKey newKeyUIncludeIdx = schema.getFactoryTSecGroupInclude()
            .newUIncludeIdxKey();
    newKeyUIncludeIdx.setRequiredTenantId(Buff.getRequiredTenantId());
    newKeyUIncludeIdx.setRequiredTSecGroupId(Buff.getRequiredTSecGroupId());
    newKeyUIncludeIdx.setRequiredIncludeGroupId(Buff.getRequiredIncludeGroupId());

    // Check unique indexes

    if (!existingKeyUIncludeIdx.equals(newKeyUIncludeIdx)) {
        if (dictByUIncludeIdx.containsKey(newKeyUIncludeIdx)) {
            throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(),
                    "updateTSecGroupInclude", "TSecGroupIncludeUIncludeIdx", newKeyUIncludeIdx);
        }
    }

    // Validate foreign keys

    {
        boolean allNull = true;

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

    {
        boolean allNull = true;

        if (allNull) {
            if (null == schema.getTableTSecGroup().readDerivedByIdIdx(Authorization, Buff.getRequiredTenantId(),
                    Buff.getRequiredTSecGroupId())) {
                throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                        "updateTSecGroupInclude", "Container", "TSecGroupIncludeGroup", "TSecGroup", null);
            }
        }
    }

    // Update is valid

    SortedMap<CFSecurityTSecGroupIncludePKey, CFSecurityTSecGroupIncludeBuff> 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<CFSecurityTSecGroupIncludePKey, CFSecurityTSecGroupIncludeBuff>();
        dictByTenantIdx.put(newKeyTenantIdx, subdict);
    }
    subdict.put(pkey, Buff);

    subdict = dictByGroupIdx.get(existingKeyGroupIdx);
    if (subdict != null) {
        subdict.remove(pkey);
    }
    if (dictByGroupIdx.containsKey(newKeyGroupIdx)) {
        subdict = dictByGroupIdx.get(newKeyGroupIdx);
    } else {
        subdict = new TreeMap<CFSecurityTSecGroupIncludePKey, CFSecurityTSecGroupIncludeBuff>();
        dictByGroupIdx.put(newKeyGroupIdx, subdict);
    }
    subdict.put(pkey, Buff);

    subdict = dictByIncludeIdx.get(existingKeyIncludeIdx);
    if (subdict != null) {
        subdict.remove(pkey);
    }
    if (dictByIncludeIdx.containsKey(newKeyIncludeIdx)) {
        subdict = dictByIncludeIdx.get(newKeyIncludeIdx);
    } else {
        subdict = new TreeMap<CFSecurityTSecGroupIncludePKey, CFSecurityTSecGroupIncludeBuff>();
        dictByIncludeIdx.put(newKeyIncludeIdx, subdict);
    }
    subdict.put(pkey, Buff);

    dictByUIncludeIdx.remove(existingKeyUIncludeIdx);
    dictByUIncludeIdx.put(newKeyUIncludeIdx, Buff);

}

From source file:net.sourceforge.msscodefactory.cfsecurity.v2_0.CFSecurityRam.CFSecurityRamTSecGroupIncludeTable.java

public void deleteTSecGroupInclude(CFSecurityAuthorization Authorization, CFSecurityTSecGroupIncludeBuff Buff) {
    final String S_ProcName = "CFSecurityRamTSecGroupIncludeTable.deleteTSecGroupInclude() ";
    CFSecurityTSecGroupIncludePKey pkey = schema.getFactoryTSecGroupInclude().newPKey();
    pkey.setRequiredTenantId(Buff.getRequiredTenantId());
    pkey.setRequiredTSecGroupIncludeId(Buff.getRequiredTSecGroupIncludeId());
    CFSecurityTSecGroupIncludeBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        return;/*from   w w w  .  j  a v a2s. c o m*/
    }
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(),
                "deleteTSecGroupInclude", pkey);
    }
    CFSecurityTSecGroupIncludeByTenantIdxKey keyTenantIdx = schema.getFactoryTSecGroupInclude()
            .newTenantIdxKey();
    keyTenantIdx.setRequiredTenantId(existing.getRequiredTenantId());

    CFSecurityTSecGroupIncludeByGroupIdxKey keyGroupIdx = schema.getFactoryTSecGroupInclude().newGroupIdxKey();
    keyGroupIdx.setRequiredTenantId(existing.getRequiredTenantId());
    keyGroupIdx.setRequiredTSecGroupId(existing.getRequiredTSecGroupId());

    CFSecurityTSecGroupIncludeByIncludeIdxKey keyIncludeIdx = schema.getFactoryTSecGroupInclude()
            .newIncludeIdxKey();
    keyIncludeIdx.setRequiredTenantId(existing.getRequiredTenantId());
    keyIncludeIdx.setRequiredIncludeGroupId(existing.getRequiredIncludeGroupId());

    CFSecurityTSecGroupIncludeByUIncludeIdxKey keyUIncludeIdx = schema.getFactoryTSecGroupInclude()
            .newUIncludeIdxKey();
    keyUIncludeIdx.setRequiredTenantId(existing.getRequiredTenantId());
    keyUIncludeIdx.setRequiredTSecGroupId(existing.getRequiredTSecGroupId());
    keyUIncludeIdx.setRequiredIncludeGroupId(existing.getRequiredIncludeGroupId());

    // Validate reverse foreign keys

    // Delete is valid

    SortedMap<CFSecurityTSecGroupIncludePKey, CFSecurityTSecGroupIncludeBuff> subdict;

    dictByPKey.remove(pkey);

    subdict = dictByTenantIdx.get(keyTenantIdx);
    subdict.remove(pkey);

    subdict = dictByGroupIdx.get(keyGroupIdx);
    subdict.remove(pkey);

    subdict = dictByIncludeIdx.get(keyIncludeIdx);
    subdict.remove(pkey);

    dictByUIncludeIdx.remove(keyUIncludeIdx);

}

From source file:net.sourceforge.msscodefactory.cfsecurity.v2_0.CFSecurityRam.CFSecurityRamTSecGroupMemberTable.java

public void updateTSecGroupMember(CFSecurityAuthorization Authorization, CFSecurityTSecGroupMemberBuff Buff) {
    CFSecurityTSecGroupMemberPKey pkey = schema.getFactoryTSecGroupMember().newPKey();
    pkey.setRequiredTenantId(Buff.getRequiredTenantId());
    pkey.setRequiredTSecGroupMemberId(Buff.getRequiredTSecGroupMemberId());
    CFSecurityTSecGroupMemberBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(),
                "updateTSecGroupMember", "Existing record not found", "TSecGroupMember", pkey);
    }/*from   w ww  .  j  av  a2s  . c  o m*/
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(),
                "updateTSecGroupMember", pkey);
    }
    Buff.setRequiredRevision(Buff.getRequiredRevision() + 1);
    CFSecurityTSecGroupMemberByTenantIdxKey existingKeyTenantIdx = schema.getFactoryTSecGroupMember()
            .newTenantIdxKey();
    existingKeyTenantIdx.setRequiredTenantId(existing.getRequiredTenantId());

    CFSecurityTSecGroupMemberByTenantIdxKey newKeyTenantIdx = schema.getFactoryTSecGroupMember()
            .newTenantIdxKey();
    newKeyTenantIdx.setRequiredTenantId(Buff.getRequiredTenantId());

    CFSecurityTSecGroupMemberByGroupIdxKey existingKeyGroupIdx = schema.getFactoryTSecGroupMember()
            .newGroupIdxKey();
    existingKeyGroupIdx.setRequiredTenantId(existing.getRequiredTenantId());
    existingKeyGroupIdx.setRequiredTSecGroupId(existing.getRequiredTSecGroupId());

    CFSecurityTSecGroupMemberByGroupIdxKey newKeyGroupIdx = schema.getFactoryTSecGroupMember().newGroupIdxKey();
    newKeyGroupIdx.setRequiredTenantId(Buff.getRequiredTenantId());
    newKeyGroupIdx.setRequiredTSecGroupId(Buff.getRequiredTSecGroupId());

    CFSecurityTSecGroupMemberByUserIdxKey existingKeyUserIdx = schema.getFactoryTSecGroupMember()
            .newUserIdxKey();
    existingKeyUserIdx.setRequiredSecUserId(existing.getRequiredSecUserId());

    CFSecurityTSecGroupMemberByUserIdxKey newKeyUserIdx = schema.getFactoryTSecGroupMember().newUserIdxKey();
    newKeyUserIdx.setRequiredSecUserId(Buff.getRequiredSecUserId());

    CFSecurityTSecGroupMemberByUUserIdxKey existingKeyUUserIdx = schema.getFactoryTSecGroupMember()
            .newUUserIdxKey();
    existingKeyUUserIdx.setRequiredTenantId(existing.getRequiredTenantId());
    existingKeyUUserIdx.setRequiredTSecGroupId(existing.getRequiredTSecGroupId());
    existingKeyUUserIdx.setRequiredSecUserId(existing.getRequiredSecUserId());

    CFSecurityTSecGroupMemberByUUserIdxKey newKeyUUserIdx = schema.getFactoryTSecGroupMember().newUUserIdxKey();
    newKeyUUserIdx.setRequiredTenantId(Buff.getRequiredTenantId());
    newKeyUUserIdx.setRequiredTSecGroupId(Buff.getRequiredTSecGroupId());
    newKeyUUserIdx.setRequiredSecUserId(Buff.getRequiredSecUserId());

    // Check unique indexes

    if (!existingKeyUUserIdx.equals(newKeyUUserIdx)) {
        if (dictByUUserIdx.containsKey(newKeyUUserIdx)) {
            throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(),
                    "updateTSecGroupMember", "TSecGroupMemberUUserIdx", newKeyUUserIdx);
        }
    }

    // Validate foreign keys

    {
        boolean allNull = true;

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

    {
        boolean allNull = true;

        if (allNull) {
            if (null == schema.getTableTSecGroup().readDerivedByIdIdx(Authorization, Buff.getRequiredTenantId(),
                    Buff.getRequiredTSecGroupId())) {
                throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                        "updateTSecGroupMember", "Container", "TSecGroupMemberGroup", "TSecGroup", null);
            }
        }
    }

    // Update is valid

    SortedMap<CFSecurityTSecGroupMemberPKey, CFSecurityTSecGroupMemberBuff> 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<CFSecurityTSecGroupMemberPKey, CFSecurityTSecGroupMemberBuff>();
        dictByTenantIdx.put(newKeyTenantIdx, subdict);
    }
    subdict.put(pkey, Buff);

    subdict = dictByGroupIdx.get(existingKeyGroupIdx);
    if (subdict != null) {
        subdict.remove(pkey);
    }
    if (dictByGroupIdx.containsKey(newKeyGroupIdx)) {
        subdict = dictByGroupIdx.get(newKeyGroupIdx);
    } else {
        subdict = new TreeMap<CFSecurityTSecGroupMemberPKey, CFSecurityTSecGroupMemberBuff>();
        dictByGroupIdx.put(newKeyGroupIdx, subdict);
    }
    subdict.put(pkey, Buff);

    subdict = dictByUserIdx.get(existingKeyUserIdx);
    if (subdict != null) {
        subdict.remove(pkey);
    }
    if (dictByUserIdx.containsKey(newKeyUserIdx)) {
        subdict = dictByUserIdx.get(newKeyUserIdx);
    } else {
        subdict = new TreeMap<CFSecurityTSecGroupMemberPKey, CFSecurityTSecGroupMemberBuff>();
        dictByUserIdx.put(newKeyUserIdx, subdict);
    }
    subdict.put(pkey, Buff);

    dictByUUserIdx.remove(existingKeyUUserIdx);
    dictByUUserIdx.put(newKeyUUserIdx, Buff);

}

From source file:net.sourceforge.msscodefactory.cfsecurity.v2_0.CFSecurityRam.CFSecurityRamTSecGroupMemberTable.java

public void deleteTSecGroupMember(CFSecurityAuthorization Authorization, CFSecurityTSecGroupMemberBuff Buff) {
    final String S_ProcName = "CFSecurityRamTSecGroupMemberTable.deleteTSecGroupMember() ";
    CFSecurityTSecGroupMemberPKey pkey = schema.getFactoryTSecGroupMember().newPKey();
    pkey.setRequiredTenantId(Buff.getRequiredTenantId());
    pkey.setRequiredTSecGroupMemberId(Buff.getRequiredTSecGroupMemberId());
    CFSecurityTSecGroupMemberBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        return;//from  w w w  .j ava  2 s  .c  om
    }
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(),
                "deleteTSecGroupMember", pkey);
    }
    CFSecurityTSecGroupMemberByTenantIdxKey keyTenantIdx = schema.getFactoryTSecGroupMember().newTenantIdxKey();
    keyTenantIdx.setRequiredTenantId(existing.getRequiredTenantId());

    CFSecurityTSecGroupMemberByGroupIdxKey keyGroupIdx = schema.getFactoryTSecGroupMember().newGroupIdxKey();
    keyGroupIdx.setRequiredTenantId(existing.getRequiredTenantId());
    keyGroupIdx.setRequiredTSecGroupId(existing.getRequiredTSecGroupId());

    CFSecurityTSecGroupMemberByUserIdxKey keyUserIdx = schema.getFactoryTSecGroupMember().newUserIdxKey();
    keyUserIdx.setRequiredSecUserId(existing.getRequiredSecUserId());

    CFSecurityTSecGroupMemberByUUserIdxKey keyUUserIdx = schema.getFactoryTSecGroupMember().newUUserIdxKey();
    keyUUserIdx.setRequiredTenantId(existing.getRequiredTenantId());
    keyUUserIdx.setRequiredTSecGroupId(existing.getRequiredTSecGroupId());
    keyUUserIdx.setRequiredSecUserId(existing.getRequiredSecUserId());

    // Validate reverse foreign keys

    // Delete is valid

    SortedMap<CFSecurityTSecGroupMemberPKey, CFSecurityTSecGroupMemberBuff> subdict;

    dictByPKey.remove(pkey);

    subdict = dictByTenantIdx.get(keyTenantIdx);
    subdict.remove(pkey);

    subdict = dictByGroupIdx.get(keyGroupIdx);
    subdict.remove(pkey);

    subdict = dictByUserIdx.get(keyUserIdx);
    subdict.remove(pkey);

    dictByUUserIdx.remove(keyUUserIdx);

}

From source file:net.sourceforge.msscodefactory.cfsecurity.v2_0.CFSecurityRam.CFSecurityRamTSecGroupTable.java

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

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

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

    CFSecurityTSecGroupByUNameIdxKey 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<CFSecurityTSecGroupPKey, CFSecurityTSecGroupBuff> 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<CFSecurityTSecGroupPKey, CFSecurityTSecGroupBuff>();
        dictByTenantIdx.put(newKeyTenantIdx, subdict);
    }
    subdict.put(pkey, Buff);

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

}

From source file:net.sourceforge.msscodefactory.cfsecurity.v2_0.CFSecurityRam.CFSecurityRamTSecGroupTable.java

public void deleteTSecGroup(CFSecurityAuthorization Authorization, CFSecurityTSecGroupBuff Buff) {
    final String S_ProcName = "CFSecurityRamTSecGroupTable.deleteTSecGroup() ";
    CFSecurityTSecGroupPKey pkey = schema.getFactoryTSecGroup().newPKey();
    pkey.setRequiredTenantId(Buff.getRequiredTenantId());
    pkey.setRequiredTSecGroupId(Buff.getRequiredTSecGroupId());
    CFSecurityTSecGroupBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        return;/*from   w  ww.j  a  v  a  2s  . c om*/
    }
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteTSecGroup",
                pkey);
    }
    CFSecurityTSecGroupByTenantIdxKey keyTenantIdx = schema.getFactoryTSecGroup().newTenantIdxKey();
    keyTenantIdx.setRequiredTenantId(existing.getRequiredTenantId());

    CFSecurityTSecGroupByUNameIdxKey keyUNameIdx = schema.getFactoryTSecGroup().newUNameIdxKey();
    keyUNameIdx.setRequiredTenantId(existing.getRequiredTenantId());
    keyUNameIdx.setRequiredName(existing.getRequiredName());

    // Validate reverse foreign keys

    // Delete is valid

    schema.getTableTSecGroupInclude().deleteTSecGroupIncludeByGroupIdx(Authorization,
            Buff.getRequiredTenantId(), Buff.getRequiredTSecGroupId());
    schema.getTableTSecGroupMember().deleteTSecGroupMemberByGroupIdx(Authorization, Buff.getRequiredTenantId(),
            Buff.getRequiredTSecGroupId());
    schema.getTableTSecGroupInclude().deleteTSecGroupIncludeByIncludeIdx(Authorization,
            Buff.getRequiredTenantId(), Buff.getRequiredTSecGroupId());
    SortedMap<CFSecurityTSecGroupPKey, CFSecurityTSecGroupBuff> subdict;

    dictByPKey.remove(pkey);

    subdict = dictByTenantIdx.get(keyTenantIdx);
    subdict.remove(pkey);

    dictByUNameIdx.remove(keyUNameIdx);

}

From source file:net.sourceforge.msscodefactory.v1_10.MSSBamRam.MSSBamRamAccessFrequencyTable.java

public void updateAccessFrequency(MSSBamAuthorization Authorization, MSSBamAccessFrequencyBuff Buff) {
    MSSBamAccessFrequencyPKey pkey = schema.getFactoryAccessFrequency().newPKey();
    pkey.setRequiredId(Buff.getRequiredId());
    MSSBamAccessFrequencyBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(),
                "updateAccessFrequency", "Existing record not found", "AccessFrequency", pkey);
    }//from  w w w .  j  a va  2  s  . c o m
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(),
                "updateAccessFrequency", pkey);
    }
    Buff.setRequiredRevision(Buff.getRequiredRevision() + 1);
    MSSBamAccessFrequencyByUNameIdxKey existingKeyUNameIdx = schema.getFactoryAccessFrequency()
            .newUNameIdxKey();
    existingKeyUNameIdx.setRequiredName(existing.getRequiredName());

    MSSBamAccessFrequencyByUNameIdxKey newKeyUNameIdx = schema.getFactoryAccessFrequency().newUNameIdxKey();
    newKeyUNameIdx.setRequiredName(Buff.getRequiredName());

    // Check unique indexes

    // Validate foreign keys

    // Update is valid

    SortedMap<MSSBamAccessFrequencyPKey, MSSBamAccessFrequencyBuff> subdict;

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

    subdict = dictByUNameIdx.get(existingKeyUNameIdx);
    if (subdict != null) {
        subdict.remove(pkey);
    }
    if (dictByUNameIdx.containsKey(newKeyUNameIdx)) {
        subdict = dictByUNameIdx.get(newKeyUNameIdx);
    } else {
        subdict = new TreeMap<MSSBamAccessFrequencyPKey, MSSBamAccessFrequencyBuff>();
        dictByUNameIdx.put(newKeyUNameIdx, subdict);
    }
    subdict.put(pkey, Buff);

}

From source file:net.sourceforge.msscodefactory.v1_10.MSSBamRam.MSSBamRamAccessFrequencyTable.java

public void deleteAccessFrequency(MSSBamAuthorization Authorization, MSSBamAccessFrequencyBuff Buff) {
    final String S_ProcName = "MSSBamRamAccessFrequencyTable.deleteAccessFrequency() ";
    MSSBamAccessFrequencyPKey pkey = schema.getFactoryAccessFrequency().newPKey();

    pkey.setRequiredId(Buff.getRequiredId());
    MSSBamAccessFrequencyBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(),
                "deleteAccessFrequency", "Existing record not found", "AccessFrequency", pkey);
    }/* w  w  w  .  ja v  a2 s  .  c o  m*/
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(),
                "deleteAccessFrequency", pkey);
    }
    MSSBamAccessFrequencyByUNameIdxKey keyUNameIdx = schema.getFactoryAccessFrequency().newUNameIdxKey();
    keyUNameIdx.setRequiredName(existing.getRequiredName());

    // Validate reverse foreign keys

    // Delete is valid

    SortedMap<MSSBamAccessFrequencyPKey, MSSBamAccessFrequencyBuff> subdict;

    dictByPKey.remove(pkey);

    subdict = dictByUNameIdx.get(keyUNameIdx);
    subdict.remove(pkey);

}

From source file:net.sourceforge.msscodefactory.v1_10.MSSBamRam.MSSBamRamAccessSecurityTable.java

public void updateAccessSecurity(MSSBamAuthorization Authorization, MSSBamAccessSecurityBuff Buff) {
    MSSBamAccessSecurityPKey pkey = schema.getFactoryAccessSecurity().newPKey();
    pkey.setRequiredId(Buff.getRequiredId());
    MSSBamAccessSecurityBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(),
                "updateAccessSecurity", "Existing record not found", "AccessSecurity", pkey);
    }/*from   ww w  .  j  a va 2  s .  c  o m*/
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(),
                "updateAccessSecurity", pkey);
    }
    Buff.setRequiredRevision(Buff.getRequiredRevision() + 1);
    MSSBamAccessSecurityByUNameIdxKey existingKeyUNameIdx = schema.getFactoryAccessSecurity().newUNameIdxKey();
    existingKeyUNameIdx.setRequiredName(existing.getRequiredName());

    MSSBamAccessSecurityByUNameIdxKey newKeyUNameIdx = schema.getFactoryAccessSecurity().newUNameIdxKey();
    newKeyUNameIdx.setRequiredName(Buff.getRequiredName());

    // Check unique indexes

    // Validate foreign keys

    // Update is valid

    SortedMap<MSSBamAccessSecurityPKey, MSSBamAccessSecurityBuff> subdict;

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

    subdict = dictByUNameIdx.get(existingKeyUNameIdx);
    if (subdict != null) {
        subdict.remove(pkey);
    }
    if (dictByUNameIdx.containsKey(newKeyUNameIdx)) {
        subdict = dictByUNameIdx.get(newKeyUNameIdx);
    } else {
        subdict = new TreeMap<MSSBamAccessSecurityPKey, MSSBamAccessSecurityBuff>();
        dictByUNameIdx.put(newKeyUNameIdx, subdict);
    }
    subdict.put(pkey, Buff);

}