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.cfacc.v2_0.CFAccRam.CFAccRamContactURLTable.java

public void deleteContactURL(CFAccAuthorization Authorization, CFAccContactURLBuff Buff) {
    final String S_ProcName = "CFAccRamContactURLTable.deleteContactURL() ";
    CFAccContactURLPKey pkey = schema.getFactoryContactURL().newPKey();
    pkey.setRequiredTenantId(Buff.getRequiredTenantId());
    pkey.setRequiredContactURLId(Buff.getRequiredContactURLId());
    CFAccContactURLBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        return;//from www. ja  va 2 s  .  co m
    }
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteContactURL",
                pkey);
    }
    CFAccContactURLByTenantIdxKey keyTenantIdx = schema.getFactoryContactURL().newTenantIdxKey();
    keyTenantIdx.setRequiredTenantId(existing.getRequiredTenantId());

    CFAccContactURLByContactIdxKey keyContactIdx = schema.getFactoryContactURL().newContactIdxKey();
    keyContactIdx.setRequiredTenantId(existing.getRequiredTenantId());
    keyContactIdx.setRequiredContactId(existing.getRequiredContactId());

    CFAccContactURLByProtocolIdxKey keyProtocolIdx = schema.getFactoryContactURL().newProtocolIdxKey();
    keyProtocolIdx.setOptionalURLProtocolId(existing.getOptionalURLProtocolId());

    CFAccContactURLByUNameIdxKey keyUNameIdx = schema.getFactoryContactURL().newUNameIdxKey();
    keyUNameIdx.setRequiredTenantId(existing.getRequiredTenantId());
    keyUNameIdx.setRequiredContactId(existing.getRequiredContactId());
    keyUNameIdx.setRequiredName(existing.getRequiredName());

    // Validate reverse foreign keys

    // Delete is valid

    SortedMap<CFAccContactURLPKey, CFAccContactURLBuff> subdict;

    dictByPKey.remove(pkey);

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

    subdict = dictByContactIdx.get(keyContactIdx);
    subdict.remove(pkey);

    subdict = dictByProtocolIdx.get(keyProtocolIdx);
    subdict.remove(pkey);

    dictByUNameIdx.remove(keyUNameIdx);

}

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

public void deleteAttachment(CFAccAuthorization Authorization, CFAccAttachmentBuff Buff) {
    final String S_ProcName = "CFAccRamAttachmentTable.deleteAttachment() ";
    CFAccAttachmentPKey pkey = schema.getFactoryAttachment().newPKey();
    pkey.setRequiredTenantId(Buff.getRequiredTenantId());
    pkey.setRequiredAttachmentId(Buff.getRequiredAttachmentId());
    CFAccAttachmentBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        return;/*from   ww w. j a v a 2s . co m*/
    }
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteAttachment",
                pkey);
    }
    CFAccAttachmentByTenantIdxKey keyTenantIdx = schema.getFactoryAttachment().newTenantIdxKey();
    keyTenantIdx.setRequiredTenantId(existing.getRequiredTenantId());

    CFAccAttachmentByContactIdxKey keyContactIdx = schema.getFactoryAttachment().newContactIdxKey();
    keyContactIdx.setRequiredTenantId(existing.getRequiredTenantId());
    keyContactIdx.setRequiredContactId(existing.getRequiredContactId());

    CFAccAttachmentByUDescrIdxKey keyUDescrIdx = schema.getFactoryAttachment().newUDescrIdxKey();
    keyUDescrIdx.setRequiredTenantId(existing.getRequiredTenantId());
    keyUDescrIdx.setRequiredContactId(existing.getRequiredContactId());
    keyUDescrIdx.setRequiredDescription(existing.getRequiredDescription());

    CFAccAttachmentByMimeTypeIdxKey keyMimeTypeIdx = schema.getFactoryAttachment().newMimeTypeIdxKey();
    keyMimeTypeIdx.setOptionalMimeTypeId(existing.getOptionalMimeTypeId());

    // Validate reverse foreign keys

    // Delete is valid

    schema.getTableAttachmentTag().deleteAttachmentTagByAttIdx(Authorization, Buff.getRequiredTenantId(),
            Buff.getRequiredAttachmentId());
    SortedMap<CFAccAttachmentPKey, CFAccAttachmentBuff> subdict;

    dictByPKey.remove(pkey);

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

    subdict = dictByContactIdx.get(keyContactIdx);
    subdict.remove(pkey);

    dictByUDescrIdx.remove(keyUDescrIdx);

    subdict = dictByMimeTypeIdx.get(keyMimeTypeIdx);
    subdict.remove(pkey);

}

From source file:net.sourceforge.msscodefactory.cfcrm.v2_0.CFCrmRam.CFCrmRamSecFormTable.java

public void updateSecForm(CFCrmAuthorization Authorization, CFCrmSecFormBuff Buff) {
    CFCrmSecFormPKey pkey = schema.getFactorySecForm().newPKey();
    pkey.setRequiredClusterId(Buff.getRequiredClusterId());
    pkey.setRequiredSecFormId(Buff.getRequiredSecFormId());
    CFCrmSecFormBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateSecForm",
                "Existing record not found", "SecForm", pkey);
    }//from  w  w w.  java 2s  .c o m
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "updateSecForm",
                pkey);
    }
    Buff.setRequiredRevision(Buff.getRequiredRevision() + 1);
    CFCrmSecFormByClusterIdxKey existingKeyClusterIdx = schema.getFactorySecForm().newClusterIdxKey();
    existingKeyClusterIdx.setRequiredClusterId(existing.getRequiredClusterId());

    CFCrmSecFormByClusterIdxKey newKeyClusterIdx = schema.getFactorySecForm().newClusterIdxKey();
    newKeyClusterIdx.setRequiredClusterId(Buff.getRequiredClusterId());

    CFCrmSecFormBySecAppIdxKey existingKeySecAppIdx = schema.getFactorySecForm().newSecAppIdxKey();
    existingKeySecAppIdx.setRequiredClusterId(existing.getRequiredClusterId());
    existingKeySecAppIdx.setRequiredSecAppId(existing.getRequiredSecAppId());

    CFCrmSecFormBySecAppIdxKey newKeySecAppIdx = schema.getFactorySecForm().newSecAppIdxKey();
    newKeySecAppIdx.setRequiredClusterId(Buff.getRequiredClusterId());
    newKeySecAppIdx.setRequiredSecAppId(Buff.getRequiredSecAppId());

    CFCrmSecFormByUJEEServletIdxKey existingKeyUJEEServletIdx = schema.getFactorySecForm()
            .newUJEEServletIdxKey();
    existingKeyUJEEServletIdx.setRequiredClusterId(existing.getRequiredClusterId());
    existingKeyUJEEServletIdx.setRequiredSecAppId(existing.getRequiredSecAppId());
    existingKeyUJEEServletIdx.setRequiredJEEServletMapName(existing.getRequiredJEEServletMapName());

    CFCrmSecFormByUJEEServletIdxKey newKeyUJEEServletIdx = schema.getFactorySecForm().newUJEEServletIdxKey();
    newKeyUJEEServletIdx.setRequiredClusterId(Buff.getRequiredClusterId());
    newKeyUJEEServletIdx.setRequiredSecAppId(Buff.getRequiredSecAppId());
    newKeyUJEEServletIdx.setRequiredJEEServletMapName(Buff.getRequiredJEEServletMapName());

    // Check unique indexes

    if (!existingKeyUJEEServletIdx.equals(newKeyUJEEServletIdx)) {
        if (dictByUJEEServletIdx.containsKey(newKeyUJEEServletIdx)) {
            throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(),
                    "updateSecForm", "SecFormUJEEServletIdx", newKeyUJEEServletIdx);
        }
    }

    // Validate foreign keys

    {
        boolean allNull = true;

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

    {
        boolean allNull = true;

        if (allNull) {
            if (null == schema.getTableSecApp().readDerivedByIdIdx(Authorization, Buff.getRequiredClusterId(),
                    Buff.getRequiredSecAppId())) {
                throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                        "updateSecForm", "Container", "SecFormApplication", "SecApp", null);
            }
        }
    }

    // Update is valid

    SortedMap<CFCrmSecFormPKey, CFCrmSecFormBuff> 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<CFCrmSecFormPKey, CFCrmSecFormBuff>();
        dictByClusterIdx.put(newKeyClusterIdx, subdict);
    }
    subdict.put(pkey, Buff);

    subdict = dictBySecAppIdx.get(existingKeySecAppIdx);
    if (subdict != null) {
        subdict.remove(pkey);
    }
    if (dictBySecAppIdx.containsKey(newKeySecAppIdx)) {
        subdict = dictBySecAppIdx.get(newKeySecAppIdx);
    } else {
        subdict = new TreeMap<CFCrmSecFormPKey, CFCrmSecFormBuff>();
        dictBySecAppIdx.put(newKeySecAppIdx, subdict);
    }
    subdict.put(pkey, Buff);

    dictByUJEEServletIdx.remove(existingKeyUJEEServletIdx);
    dictByUJEEServletIdx.put(newKeyUJEEServletIdx, Buff);

}

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

public void updateMemo(CFAccAuthorization Authorization, CFAccMemoBuff Buff) {
    CFAccMemoPKey pkey = schema.getFactoryMemo().newPKey();
    pkey.setRequiredTenantId(Buff.getRequiredTenantId());
    pkey.setRequiredMemoId(Buff.getRequiredMemoId());
    CFAccMemoBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateMemo",
                "Existing record not found", "Memo", pkey);
    }//from  w ww . j a  v a 2s .c om
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "updateMemo", pkey);
    }
    Buff.setRequiredRevision(Buff.getRequiredRevision() + 1);
    CFAccMemoByTenantIdxKey existingKeyTenantIdx = schema.getFactoryMemo().newTenantIdxKey();
    existingKeyTenantIdx.setRequiredTenantId(existing.getRequiredTenantId());

    CFAccMemoByTenantIdxKey newKeyTenantIdx = schema.getFactoryMemo().newTenantIdxKey();
    newKeyTenantIdx.setRequiredTenantId(Buff.getRequiredTenantId());

    CFAccMemoByMemoContactIdxKey existingKeyMemoContactIdx = schema.getFactoryMemo().newMemoContactIdxKey();
    existingKeyMemoContactIdx.setRequiredTenantId(existing.getRequiredTenantId());
    existingKeyMemoContactIdx.setRequiredContactId(existing.getRequiredContactId());

    CFAccMemoByMemoContactIdxKey newKeyMemoContactIdx = schema.getFactoryMemo().newMemoContactIdxKey();
    newKeyMemoContactIdx.setRequiredTenantId(Buff.getRequiredTenantId());
    newKeyMemoContactIdx.setRequiredContactId(Buff.getRequiredContactId());

    CFAccMemoByUDescrIdxKey existingKeyUDescrIdx = schema.getFactoryMemo().newUDescrIdxKey();
    existingKeyUDescrIdx.setRequiredTenantId(existing.getRequiredTenantId());
    existingKeyUDescrIdx.setRequiredContactId(existing.getRequiredContactId());
    existingKeyUDescrIdx.setRequiredDescription(existing.getRequiredDescription());

    CFAccMemoByUDescrIdxKey newKeyUDescrIdx = schema.getFactoryMemo().newUDescrIdxKey();
    newKeyUDescrIdx.setRequiredTenantId(Buff.getRequiredTenantId());
    newKeyUDescrIdx.setRequiredContactId(Buff.getRequiredContactId());
    newKeyUDescrIdx.setRequiredDescription(Buff.getRequiredDescription());

    // Check unique indexes

    if (!existingKeyUDescrIdx.equals(newKeyUDescrIdx)) {
        if (dictByUDescrIdx.containsKey(newKeyUDescrIdx)) {
            throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), "updateMemo",
                    "MemoUDescrIdx", newKeyUDescrIdx);
        }
    }

    // Validate foreign keys

    {
        boolean allNull = true;

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

    {
        boolean allNull = true;

        if (allNull) {
            if (null == schema.getTableContact().readDerivedByIdIdx(Authorization, Buff.getRequiredTenantId(),
                    Buff.getRequiredContactId())) {
                throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                        "updateMemo", "Container", "MemoContact", "Contact", null);
            }
        }
    }

    // Update is valid

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

    subdict = dictByMemoContactIdx.get(existingKeyMemoContactIdx);
    if (subdict != null) {
        subdict.remove(pkey);
    }
    if (dictByMemoContactIdx.containsKey(newKeyMemoContactIdx)) {
        subdict = dictByMemoContactIdx.get(newKeyMemoContactIdx);
    } else {
        subdict = new TreeMap<CFAccMemoPKey, CFAccMemoBuff>();
        dictByMemoContactIdx.put(newKeyMemoContactIdx, subdict);
    }
    subdict.put(pkey, Buff);

    dictByUDescrIdx.remove(existingKeyUDescrIdx);
    dictByUDescrIdx.put(newKeyUDescrIdx, Buff);

}

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

public void deleteAccount(CFAccAuthorization Authorization, CFAccAccountBuff Buff) {
    final String S_ProcName = "CFAccRamAccountTable.deleteAccount() ";
    CFAccAccountPKey pkey = schema.getFactoryAccount().newPKey();
    pkey.setRequiredTenantId(Buff.getRequiredTenantId());
    pkey.setRequiredId(Buff.getRequiredId());
    CFAccAccountBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        return;/*w w w. j av a  2s.  c o m*/
    }
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteAccount",
                pkey);
    }
    CFAccAccountByUCodeIdxKey keyUCodeIdx = schema.getFactoryAccount().newUCodeIdxKey();
    keyUCodeIdx.setRequiredTenantId(existing.getRequiredTenantId());
    keyUCodeIdx.setRequiredAccountCode(existing.getRequiredAccountCode());

    CFAccAccountByTenantIdxKey keyTenantIdx = schema.getFactoryAccount().newTenantIdxKey();
    keyTenantIdx.setRequiredTenantId(existing.getRequiredTenantId());

    CFAccAccountByRollupAcctIdxKey keyRollupAcctIdx = schema.getFactoryAccount().newRollupAcctIdxKey();
    keyRollupAcctIdx.setOptionalRollupTenantId(existing.getOptionalRollupTenantId());
    keyRollupAcctIdx.setOptionalRollupAccountId(existing.getOptionalRollupAccountId());

    CFAccAccountByCcyIdxKey keyCcyIdx = schema.getFactoryAccount().newCcyIdxKey();
    keyCcyIdx.setRequiredCurrencyId(existing.getRequiredCurrencyId());

    // Validate reverse foreign keys

    // Delete is valid

    schema.getTableAccount().deleteAccountByRollupAcctIdx(Authorization, Buff.getRequiredTenantId(),
            Buff.getRequiredId());
    schema.getTableAccountContact().deleteAccountContactByIdIdx(Authorization, Buff.getRequiredTenantId(),
            Buff.getRequiredId());
    schema.getTableAccountEntry().deleteAccountEntryByAcctIdx(Authorization, Buff.getRequiredTenantId(),
            Buff.getRequiredId());
    SortedMap<CFAccAccountPKey, CFAccAccountBuff> subdict;

    dictByPKey.remove(pkey);

    dictByUCodeIdx.remove(keyUCodeIdx);

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

    subdict = dictByRollupAcctIdx.get(keyRollupAcctIdx);
    subdict.remove(pkey);

    subdict = dictByCcyIdx.get(keyCcyIdx);
    subdict.remove(pkey);

}

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

public void deleteContact(CFAccAuthorization Authorization, CFAccContactBuff Buff) {
    final String S_ProcName = "CFAccRamContactTable.deleteContact() ";
    CFAccContactPKey pkey = schema.getFactoryContact().newPKey();
    pkey.setRequiredTenantId(Buff.getRequiredTenantId());
    pkey.setRequiredContactId(Buff.getRequiredContactId());
    CFAccContactBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        return;/* ww  w.  j a va2s  .c  o  m*/
    }
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteContact",
                pkey);
    }
    CFAccContactByContTentIdxKey keyContTentIdx = schema.getFactoryContact().newContTentIdxKey();
    keyContTentIdx.setRequiredTenantId(existing.getRequiredTenantId());

    CFAccContactByContListIdxKey keyContListIdx = schema.getFactoryContact().newContListIdxKey();
    keyContListIdx.setRequiredTenantId(existing.getRequiredTenantId());
    keyContListIdx.setRequiredContactListId(existing.getRequiredContactListId());

    CFAccContactByFullNameIdxKey keyFullNameIdx = schema.getFactoryContact().newFullNameIdxKey();
    keyFullNameIdx.setRequiredTenantId(existing.getRequiredTenantId());
    keyFullNameIdx.setRequiredContactListId(existing.getRequiredContactListId());
    keyFullNameIdx.setRequiredFullName(existing.getRequiredFullName());

    CFAccContactByTimezoneIdxKey keyTimezoneIdx = schema.getFactoryContact().newTimezoneIdxKey();
    keyTimezoneIdx.setOptionalISOTimezoneId(existing.getOptionalISOTimezoneId());

    // Validate reverse foreign keys

    // Delete is valid

    schema.getTableContactTag().deleteContactTagByContactIdx(Authorization, Buff.getRequiredTenantId(),
            Buff.getRequiredContactId());
    schema.getTableAddress().deleteAddressByContactIdx(Authorization, Buff.getRequiredTenantId(),
            Buff.getRequiredContactId());
    schema.getTablePhone().deletePhoneByContactIdx(Authorization, Buff.getRequiredTenantId(),
            Buff.getRequiredContactId());
    schema.getTableContactURL().deleteContactURLByContactIdx(Authorization, Buff.getRequiredTenantId(),
            Buff.getRequiredContactId());
    schema.getTableMemo().deleteMemoByMemoContactIdx(Authorization, Buff.getRequiredTenantId(),
            Buff.getRequiredContactId());
    schema.getTableAccountContact().deleteAccountContactByCtctIdx(Authorization, Buff.getRequiredTenantId(),
            Buff.getRequiredContactId());
    SortedMap<CFAccContactPKey, CFAccContactBuff> subdict;

    dictByPKey.remove(pkey);

    subdict = dictByContTentIdx.get(keyContTentIdx);
    subdict.remove(pkey);

    subdict = dictByContListIdx.get(keyContListIdx);
    subdict.remove(pkey);

    dictByFullNameIdx.remove(keyFullNameIdx);

    subdict = dictByTimezoneIdx.get(keyTimezoneIdx);
    subdict.remove(pkey);

}

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

public void deleteTSecGroupMember(CFAccAuthorization Authorization, CFAccTSecGroupMemberBuff Buff) {
    final String S_ProcName = "CFAccRamTSecGroupMemberTable.deleteTSecGroupMember() ";
    CFAccTSecGroupMemberPKey pkey = schema.getFactoryTSecGroupMember().newPKey();
    pkey.setRequiredTenantId(Buff.getRequiredTenantId());
    pkey.setRequiredTSecGroupMemberId(Buff.getRequiredTSecGroupMemberId());
    CFAccTSecGroupMemberBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        return;//  w  w w.  j a  v a2 s .c  o m
    }
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(),
                "deleteTSecGroupMember", pkey);
    }
    CFAccTSecGroupMemberByTenantIdxKey keyTenantIdx = schema.getFactoryTSecGroupMember().newTenantIdxKey();
    keyTenantIdx.setRequiredTenantId(existing.getRequiredTenantId());

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

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

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

    // Validate reverse foreign keys

    // Delete is valid

    SortedMap<CFAccTSecGroupMemberPKey, CFAccTSecGroupMemberBuff> 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.cfasterisk.v2_0.CFAstRam.CFAstRamTSecGroupMemberTable.java

public void deleteTSecGroupMember(CFAstAuthorization Authorization, CFAstTSecGroupMemberBuff Buff) {
    final String S_ProcName = "CFAstRamTSecGroupMemberTable.deleteTSecGroupMember() ";
    CFAstTSecGroupMemberPKey pkey = schema.getFactoryTSecGroupMember().newPKey();
    pkey.setRequiredTenantId(Buff.getRequiredTenantId());
    pkey.setRequiredTSecGroupMemberId(Buff.getRequiredTSecGroupMemberId());
    CFAstTSecGroupMemberBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        return;// ww w  .j a va2s. c  om
    }
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(),
                "deleteTSecGroupMember", pkey);
    }
    CFAstTSecGroupMemberByTenantIdxKey keyTenantIdx = schema.getFactoryTSecGroupMember().newTenantIdxKey();
    keyTenantIdx.setRequiredTenantId(existing.getRequiredTenantId());

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

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

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

    // Validate reverse foreign keys

    // Delete is valid

    SortedMap<CFAstTSecGroupMemberPKey, CFAstTSecGroupMemberBuff> 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.cfacc.v2_0.CFAccRam.CFAccRamSecGroupMemberTable.java

public void deleteSecGroupMember(CFAccAuthorization Authorization, CFAccSecGroupMemberBuff Buff) {
    final String S_ProcName = "CFAccRamSecGroupMemberTable.deleteSecGroupMember() ";
    CFAccSecGroupMemberPKey pkey = schema.getFactorySecGroupMember().newPKey();
    pkey.setRequiredClusterId(Buff.getRequiredClusterId());
    pkey.setRequiredSecGroupMemberId(Buff.getRequiredSecGroupMemberId());
    CFAccSecGroupMemberBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        return;/* w w w. j  a v a  2  s .  c  o m*/
    }
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(),
                "deleteSecGroupMember", pkey);
    }
    CFAccSecGroupMemberByClusterIdxKey keyClusterIdx = schema.getFactorySecGroupMember().newClusterIdxKey();
    keyClusterIdx.setRequiredClusterId(existing.getRequiredClusterId());

    CFAccSecGroupMemberByGroupIdxKey keyGroupIdx = schema.getFactorySecGroupMember().newGroupIdxKey();
    keyGroupIdx.setRequiredClusterId(existing.getRequiredClusterId());
    keyGroupIdx.setRequiredSecGroupId(existing.getRequiredSecGroupId());

    CFAccSecGroupMemberByUserIdxKey keyUserIdx = schema.getFactorySecGroupMember().newUserIdxKey();
    keyUserIdx.setRequiredSecUserId(existing.getRequiredSecUserId());

    CFAccSecGroupMemberByUUserIdxKey keyUUserIdx = schema.getFactorySecGroupMember().newUUserIdxKey();
    keyUUserIdx.setRequiredClusterId(existing.getRequiredClusterId());
    keyUUserIdx.setRequiredSecGroupId(existing.getRequiredSecGroupId());
    keyUUserIdx.setRequiredSecUserId(existing.getRequiredSecUserId());

    // Validate reverse foreign keys

    // Delete is valid

    SortedMap<CFAccSecGroupMemberPKey, CFAccSecGroupMemberBuff> subdict;

    dictByPKey.remove(pkey);

    subdict = dictByClusterIdx.get(keyClusterIdx);
    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.cfasterisk.v2_0.CFAstRam.CFAstRamSecGroupMemberTable.java

public void deleteSecGroupMember(CFAstAuthorization Authorization, CFAstSecGroupMemberBuff Buff) {
    final String S_ProcName = "CFAstRamSecGroupMemberTable.deleteSecGroupMember() ";
    CFAstSecGroupMemberPKey pkey = schema.getFactorySecGroupMember().newPKey();
    pkey.setRequiredClusterId(Buff.getRequiredClusterId());
    pkey.setRequiredSecGroupMemberId(Buff.getRequiredSecGroupMemberId());
    CFAstSecGroupMemberBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        return;// ww w.  j  a  v  a2  s  .c  om
    }
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(),
                "deleteSecGroupMember", pkey);
    }
    CFAstSecGroupMemberByClusterIdxKey keyClusterIdx = schema.getFactorySecGroupMember().newClusterIdxKey();
    keyClusterIdx.setRequiredClusterId(existing.getRequiredClusterId());

    CFAstSecGroupMemberByGroupIdxKey keyGroupIdx = schema.getFactorySecGroupMember().newGroupIdxKey();
    keyGroupIdx.setRequiredClusterId(existing.getRequiredClusterId());
    keyGroupIdx.setRequiredSecGroupId(existing.getRequiredSecGroupId());

    CFAstSecGroupMemberByUserIdxKey keyUserIdx = schema.getFactorySecGroupMember().newUserIdxKey();
    keyUserIdx.setRequiredSecUserId(existing.getRequiredSecUserId());

    CFAstSecGroupMemberByUUserIdxKey keyUUserIdx = schema.getFactorySecGroupMember().newUUserIdxKey();
    keyUUserIdx.setRequiredClusterId(existing.getRequiredClusterId());
    keyUUserIdx.setRequiredSecGroupId(existing.getRequiredSecGroupId());
    keyUUserIdx.setRequiredSecUserId(existing.getRequiredSecUserId());

    // Validate reverse foreign keys

    // Delete is valid

    SortedMap<CFAstSecGroupMemberPKey, CFAstSecGroupMemberBuff> subdict;

    dictByPKey.remove(pkey);

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

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

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

    dictByUUserIdx.remove(keyUUserIdx);

}