Example usage for java.util SortedMap put

List of usage examples for java.util SortedMap put

Introduction

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

Prototype

V put(K key, V value);

Source Link

Document

Associates the specified value with the specified key in this map (optional operation).

Usage

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

public void createISOCountryCurrency(CFAccAuthorization Authorization, CFAccISOCountryCurrencyBuff Buff) {
    CFAccISOCountryCurrencyPKey pkey = schema.getFactoryISOCountryCurrency().newPKey();
    pkey.setRequiredISOCountryId(Buff.getRequiredISOCountryId());
    pkey.setRequiredISOCurrencyId(Buff.getRequiredISOCurrencyId());
    Buff.setRequiredISOCountryId(pkey.getRequiredISOCountryId());
    Buff.setRequiredISOCurrencyId(pkey.getRequiredISOCurrencyId());
    CFAccISOCountryCurrencyByCountryIdxKey keyCountryIdx = schema.getFactoryISOCountryCurrency()
            .newCountryIdxKey();// w ww . j  a va2 s  .  c om
    keyCountryIdx.setRequiredISOCountryId(Buff.getRequiredISOCountryId());

    CFAccISOCountryCurrencyByCurrencyIdxKey keyCurrencyIdx = schema.getFactoryISOCountryCurrency()
            .newCurrencyIdxKey();
    keyCurrencyIdx.setRequiredISOCurrencyId(Buff.getRequiredISOCurrencyId());

    // Validate unique indexes

    if (dictByPKey.containsKey(pkey)) {
        throw CFLib.getDefaultExceptionFactory().newPrimaryKeyNotNewException(getClass(),
                "createISOCountryCurrency", pkey);
    }

    // Validate foreign keys

    {
        boolean allNull = true;
        allNull = false;
        if (!allNull) {
            if (null == schema.getTableISOCountry().readDerivedByIdIdx(Authorization,
                    Buff.getRequiredISOCountryId())) {
                throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                        "createISOCountryCurrency", "Container", "ISOCountryCurrencyCountry", "ISOCountry",
                        null);
            }
        }
    }

    // Proceed with adding the new record

    dictByPKey.put(pkey, Buff);

    SortedMap<CFAccISOCountryCurrencyPKey, CFAccISOCountryCurrencyBuff> subdictCountryIdx;
    if (dictByCountryIdx.containsKey(keyCountryIdx)) {
        subdictCountryIdx = dictByCountryIdx.get(keyCountryIdx);
    } else {
        subdictCountryIdx = new TreeMap<CFAccISOCountryCurrencyPKey, CFAccISOCountryCurrencyBuff>();
        dictByCountryIdx.put(keyCountryIdx, subdictCountryIdx);
    }
    subdictCountryIdx.put(pkey, Buff);

    SortedMap<CFAccISOCountryCurrencyPKey, CFAccISOCountryCurrencyBuff> subdictCurrencyIdx;
    if (dictByCurrencyIdx.containsKey(keyCurrencyIdx)) {
        subdictCurrencyIdx = dictByCurrencyIdx.get(keyCurrencyIdx);
    } else {
        subdictCurrencyIdx = new TreeMap<CFAccISOCountryCurrencyPKey, CFAccISOCountryCurrencyBuff>();
        dictByCurrencyIdx.put(keyCurrencyIdx, subdictCurrencyIdx);
    }
    subdictCurrencyIdx.put(pkey, Buff);

}

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

public void createISOCountryLanguage(CFAccAuthorization Authorization, CFAccISOCountryLanguageBuff Buff) {
    CFAccISOCountryLanguagePKey pkey = schema.getFactoryISOCountryLanguage().newPKey();
    pkey.setRequiredISOCountryId(Buff.getRequiredISOCountryId());
    pkey.setRequiredISOLanguageId(Buff.getRequiredISOLanguageId());
    Buff.setRequiredISOCountryId(pkey.getRequiredISOCountryId());
    Buff.setRequiredISOLanguageId(pkey.getRequiredISOLanguageId());
    CFAccISOCountryLanguageByCountryIdxKey keyCountryIdx = schema.getFactoryISOCountryLanguage()
            .newCountryIdxKey();/*from  w  w  w.jav  a2s  .co m*/
    keyCountryIdx.setRequiredISOCountryId(Buff.getRequiredISOCountryId());

    CFAccISOCountryLanguageByLanguageIdxKey keyLanguageIdx = schema.getFactoryISOCountryLanguage()
            .newLanguageIdxKey();
    keyLanguageIdx.setRequiredISOLanguageId(Buff.getRequiredISOLanguageId());

    // Validate unique indexes

    if (dictByPKey.containsKey(pkey)) {
        throw CFLib.getDefaultExceptionFactory().newPrimaryKeyNotNewException(getClass(),
                "createISOCountryLanguage", pkey);
    }

    // Validate foreign keys

    {
        boolean allNull = true;
        allNull = false;
        if (!allNull) {
            if (null == schema.getTableISOCountry().readDerivedByIdIdx(Authorization,
                    Buff.getRequiredISOCountryId())) {
                throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                        "createISOCountryLanguage", "Container", "ISOCountryLanguageCountry", "ISOCountry",
                        null);
            }
        }
    }

    // Proceed with adding the new record

    dictByPKey.put(pkey, Buff);

    SortedMap<CFAccISOCountryLanguagePKey, CFAccISOCountryLanguageBuff> subdictCountryIdx;
    if (dictByCountryIdx.containsKey(keyCountryIdx)) {
        subdictCountryIdx = dictByCountryIdx.get(keyCountryIdx);
    } else {
        subdictCountryIdx = new TreeMap<CFAccISOCountryLanguagePKey, CFAccISOCountryLanguageBuff>();
        dictByCountryIdx.put(keyCountryIdx, subdictCountryIdx);
    }
    subdictCountryIdx.put(pkey, Buff);

    SortedMap<CFAccISOCountryLanguagePKey, CFAccISOCountryLanguageBuff> subdictLanguageIdx;
    if (dictByLanguageIdx.containsKey(keyLanguageIdx)) {
        subdictLanguageIdx = dictByLanguageIdx.get(keyLanguageIdx);
    } else {
        subdictLanguageIdx = new TreeMap<CFAccISOCountryLanguagePKey, CFAccISOCountryLanguageBuff>();
        dictByLanguageIdx.put(keyLanguageIdx, subdictLanguageIdx);
    }
    subdictLanguageIdx.put(pkey, Buff);

}

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

public void createISOCountryCurrency(CFAstAuthorization Authorization, CFAstISOCountryCurrencyBuff Buff) {
    CFAstISOCountryCurrencyPKey pkey = schema.getFactoryISOCountryCurrency().newPKey();
    pkey.setRequiredISOCountryId(Buff.getRequiredISOCountryId());
    pkey.setRequiredISOCurrencyId(Buff.getRequiredISOCurrencyId());
    Buff.setRequiredISOCountryId(pkey.getRequiredISOCountryId());
    Buff.setRequiredISOCurrencyId(pkey.getRequiredISOCurrencyId());
    CFAstISOCountryCurrencyByCountryIdxKey keyCountryIdx = schema.getFactoryISOCountryCurrency()
            .newCountryIdxKey();/*from   www.  ja va 2  s.c  o m*/
    keyCountryIdx.setRequiredISOCountryId(Buff.getRequiredISOCountryId());

    CFAstISOCountryCurrencyByCurrencyIdxKey keyCurrencyIdx = schema.getFactoryISOCountryCurrency()
            .newCurrencyIdxKey();
    keyCurrencyIdx.setRequiredISOCurrencyId(Buff.getRequiredISOCurrencyId());

    // Validate unique indexes

    if (dictByPKey.containsKey(pkey)) {
        throw CFLib.getDefaultExceptionFactory().newPrimaryKeyNotNewException(getClass(),
                "createISOCountryCurrency", pkey);
    }

    // Validate foreign keys

    {
        boolean allNull = true;
        allNull = false;
        if (!allNull) {
            if (null == schema.getTableISOCountry().readDerivedByIdIdx(Authorization,
                    Buff.getRequiredISOCountryId())) {
                throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                        "createISOCountryCurrency", "Container", "ISOCountryCurrencyCountry", "ISOCountry",
                        null);
            }
        }
    }

    // Proceed with adding the new record

    dictByPKey.put(pkey, Buff);

    SortedMap<CFAstISOCountryCurrencyPKey, CFAstISOCountryCurrencyBuff> subdictCountryIdx;
    if (dictByCountryIdx.containsKey(keyCountryIdx)) {
        subdictCountryIdx = dictByCountryIdx.get(keyCountryIdx);
    } else {
        subdictCountryIdx = new TreeMap<CFAstISOCountryCurrencyPKey, CFAstISOCountryCurrencyBuff>();
        dictByCountryIdx.put(keyCountryIdx, subdictCountryIdx);
    }
    subdictCountryIdx.put(pkey, Buff);

    SortedMap<CFAstISOCountryCurrencyPKey, CFAstISOCountryCurrencyBuff> subdictCurrencyIdx;
    if (dictByCurrencyIdx.containsKey(keyCurrencyIdx)) {
        subdictCurrencyIdx = dictByCurrencyIdx.get(keyCurrencyIdx);
    } else {
        subdictCurrencyIdx = new TreeMap<CFAstISOCountryCurrencyPKey, CFAstISOCountryCurrencyBuff>();
        dictByCurrencyIdx.put(keyCurrencyIdx, subdictCurrencyIdx);
    }
    subdictCurrencyIdx.put(pkey, Buff);

}

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

public void createISOCountryLanguage(CFAstAuthorization Authorization, CFAstISOCountryLanguageBuff Buff) {
    CFAstISOCountryLanguagePKey pkey = schema.getFactoryISOCountryLanguage().newPKey();
    pkey.setRequiredISOCountryId(Buff.getRequiredISOCountryId());
    pkey.setRequiredISOLanguageId(Buff.getRequiredISOLanguageId());
    Buff.setRequiredISOCountryId(pkey.getRequiredISOCountryId());
    Buff.setRequiredISOLanguageId(pkey.getRequiredISOLanguageId());
    CFAstISOCountryLanguageByCountryIdxKey keyCountryIdx = schema.getFactoryISOCountryLanguage()
            .newCountryIdxKey();/*from   w w w  .  j a  va2s  .  co  m*/
    keyCountryIdx.setRequiredISOCountryId(Buff.getRequiredISOCountryId());

    CFAstISOCountryLanguageByLanguageIdxKey keyLanguageIdx = schema.getFactoryISOCountryLanguage()
            .newLanguageIdxKey();
    keyLanguageIdx.setRequiredISOLanguageId(Buff.getRequiredISOLanguageId());

    // Validate unique indexes

    if (dictByPKey.containsKey(pkey)) {
        throw CFLib.getDefaultExceptionFactory().newPrimaryKeyNotNewException(getClass(),
                "createISOCountryLanguage", pkey);
    }

    // Validate foreign keys

    {
        boolean allNull = true;
        allNull = false;
        if (!allNull) {
            if (null == schema.getTableISOCountry().readDerivedByIdIdx(Authorization,
                    Buff.getRequiredISOCountryId())) {
                throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                        "createISOCountryLanguage", "Container", "ISOCountryLanguageCountry", "ISOCountry",
                        null);
            }
        }
    }

    // Proceed with adding the new record

    dictByPKey.put(pkey, Buff);

    SortedMap<CFAstISOCountryLanguagePKey, CFAstISOCountryLanguageBuff> subdictCountryIdx;
    if (dictByCountryIdx.containsKey(keyCountryIdx)) {
        subdictCountryIdx = dictByCountryIdx.get(keyCountryIdx);
    } else {
        subdictCountryIdx = new TreeMap<CFAstISOCountryLanguagePKey, CFAstISOCountryLanguageBuff>();
        dictByCountryIdx.put(keyCountryIdx, subdictCountryIdx);
    }
    subdictCountryIdx.put(pkey, Buff);

    SortedMap<CFAstISOCountryLanguagePKey, CFAstISOCountryLanguageBuff> subdictLanguageIdx;
    if (dictByLanguageIdx.containsKey(keyLanguageIdx)) {
        subdictLanguageIdx = dictByLanguageIdx.get(keyLanguageIdx);
    } else {
        subdictLanguageIdx = new TreeMap<CFAstISOCountryLanguagePKey, CFAstISOCountryLanguageBuff>();
        dictByLanguageIdx.put(keyLanguageIdx, subdictLanguageIdx);
    }
    subdictLanguageIdx.put(pkey, Buff);

}

From source file:edu.brown.benchmark.BenchmarkResults.java

public BenchmarkResults addPollResponseInfo(String clientName, int pollIndex, long time, TransactionCounter tc,
        String errMsg) {/*  w  w w .j av  a 2s.com*/
    long benchmarkTime = pollIndex * m_pollIntervalInMillis;
    long offsetTime = time - benchmarkTime;

    if (errMsg != null) {
        Error err = new Error(clientName, errMsg, pollIndex);
        m_errors.add(err);
        return (null);
    }

    if (debug.get())
        LOG.debug(String.format("Setting Poll Response Info for '%s' [%d]:\n%s", clientName, pollIndex,
                tc.transactions));

    // Update Touched Histograms
    // This doesn't need to be synchronized
    this.m_basePartitions.putHistogram(tc.basePartitions);

    BenchmarkResults finishedIntervalClone = null;
    synchronized (this) {
        // put the transactions names:
        if (m_transactionNames.isEmpty()) {
            for (String txnName : tc.transactions.values())
                m_transactionNames.add(txnName);
        }

        // ensure there is an entry for the client
        SortedMap<String, List<Result>> txnResults = m_data.get(clientName);
        if (txnResults == null) {
            txnResults = new TreeMap<String, List<Result>>();
            m_data.put(clientName, txnResults);
        }

        for (String txnName : m_transactionNames) {
            List<Result> results = txnResults.get(txnName);
            if (results == null) {
                results = new ArrayList<Result>();
                txnResults.put(txnName, results);
            }
            assert (results != null);
            Result r = new Result(offsetTime, tc.transactions.get(txnName));
            results.add(r);
        } // FOR
        this.clientResultCount.put(clientName);
        if (debug.get())
            LOG.debug(String.format("New Result for '%s' => %d [minCount=%d]", clientName,
                    this.clientResultCount.get(clientName), this.clientResultCount.getMinCount()));
        if (this.clientResultCount.getMinCount() > this.completedIntervals && m_data.size() == m_clientCount) {
            this.completedIntervals = (int) this.clientResultCount.getMinCount();
            finishedIntervalClone = this.copy();
        }
    } // SYNCH

    return (finishedIntervalClone);
}

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

public void createMajorVersion(CFAccAuthorization Authorization, CFAccMajorVersionBuff Buff) {
    schema.getTableVersion().createVersion(Authorization, Buff);
    CFAccDomainBasePKey pkey = schema.getFactoryDomainBase().newPKey();
    pkey.setClassCode(Buff.getClassCode());
    pkey.setRequiredTenantId(Buff.getRequiredTenantId());
    pkey.setRequiredId(Buff.getRequiredId());
    CFAccMajorVersionByPPrjIdxKey keyPPrjIdx = schema.getFactoryMajorVersion().newPPrjIdxKey();
    keyPPrjIdx.setRequiredTenantId(Buff.getRequiredTenantId());
    keyPPrjIdx.setRequiredParentProjectId(Buff.getRequiredParentProjectId());

    CFAccMajorVersionByNameIdxKey keyNameIdx = schema.getFactoryMajorVersion().newNameIdxKey();
    keyNameIdx.setRequiredTenantId(Buff.getRequiredTenantId());
    keyNameIdx.setRequiredParentProjectId(Buff.getRequiredParentProjectId());
    keyNameIdx.setRequiredName(Buff.getRequiredName());

    // Validate unique indexes

    if (dictByPKey.containsKey(pkey)) {
        throw CFLib.getDefaultExceptionFactory().newPrimaryKeyNotNewException(getClass(), "createMajorVersion",
                pkey);/*www . j  a  va  2s  .  c  o m*/
    }

    if (dictByNameIdx.containsKey(keyNameIdx)) {
        throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(),
                "createMajorVersion", "MajorVersionNameIdx", keyNameIdx);
    }

    // Validate foreign keys

    {
        boolean allNull = true;
        allNull = false;
        allNull = false;
        if (!allNull) {
            if (null == schema.getTableVersion().readDerivedByIdIdx(Authorization, Buff.getRequiredTenantId(),
                    Buff.getRequiredId())) {
                throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                        "createMajorVersion", "Superclass", "SuperClass", "Version", null);
            }
        }
    }

    {
        boolean allNull = true;
        allNull = false;
        allNull = false;
        if (!allNull) {
            if (null == schema.getTableRealProject().readDerivedByIdIdx(Authorization,
                    Buff.getRequiredTenantId(), Buff.getRequiredParentProjectId())) {
                throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                        "createMajorVersion", "Container", "ParentProject", "RealProject", null);
            }
        }
    }

    // Proceed with adding the new record

    dictByPKey.put(pkey, Buff);

    SortedMap<CFAccDomainBasePKey, CFAccMajorVersionBuff> subdictPPrjIdx;
    if (dictByPPrjIdx.containsKey(keyPPrjIdx)) {
        subdictPPrjIdx = dictByPPrjIdx.get(keyPPrjIdx);
    } else {
        subdictPPrjIdx = new TreeMap<CFAccDomainBasePKey, CFAccMajorVersionBuff>();
        dictByPPrjIdx.put(keyPPrjIdx, subdictPPrjIdx);
    }
    subdictPPrjIdx.put(pkey, Buff);

    dictByNameIdx.put(keyNameIdx, Buff);

}

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

public void createMajorVersion(CFAstAuthorization Authorization, CFAstMajorVersionBuff Buff) {
    schema.getTableVersion().createVersion(Authorization, Buff);
    CFAstDomainBasePKey pkey = schema.getFactoryDomainBase().newPKey();
    pkey.setClassCode(Buff.getClassCode());
    pkey.setRequiredTenantId(Buff.getRequiredTenantId());
    pkey.setRequiredId(Buff.getRequiredId());
    CFAstMajorVersionByPPrjIdxKey keyPPrjIdx = schema.getFactoryMajorVersion().newPPrjIdxKey();
    keyPPrjIdx.setRequiredTenantId(Buff.getRequiredTenantId());
    keyPPrjIdx.setRequiredParentProjectId(Buff.getRequiredParentProjectId());

    CFAstMajorVersionByNameIdxKey keyNameIdx = schema.getFactoryMajorVersion().newNameIdxKey();
    keyNameIdx.setRequiredTenantId(Buff.getRequiredTenantId());
    keyNameIdx.setRequiredParentProjectId(Buff.getRequiredParentProjectId());
    keyNameIdx.setRequiredName(Buff.getRequiredName());

    // Validate unique indexes

    if (dictByPKey.containsKey(pkey)) {
        throw CFLib.getDefaultExceptionFactory().newPrimaryKeyNotNewException(getClass(), "createMajorVersion",
                pkey);//from  w  ww.j av  a2 s .  c o m
    }

    if (dictByNameIdx.containsKey(keyNameIdx)) {
        throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(),
                "createMajorVersion", "MajorVersionNameIdx", keyNameIdx);
    }

    // Validate foreign keys

    {
        boolean allNull = true;
        allNull = false;
        allNull = false;
        if (!allNull) {
            if (null == schema.getTableVersion().readDerivedByIdIdx(Authorization, Buff.getRequiredTenantId(),
                    Buff.getRequiredId())) {
                throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                        "createMajorVersion", "Superclass", "SuperClass", "Version", null);
            }
        }
    }

    {
        boolean allNull = true;
        allNull = false;
        allNull = false;
        if (!allNull) {
            if (null == schema.getTableRealProject().readDerivedByIdIdx(Authorization,
                    Buff.getRequiredTenantId(), Buff.getRequiredParentProjectId())) {
                throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                        "createMajorVersion", "Container", "ParentProject", "RealProject", null);
            }
        }
    }

    // Proceed with adding the new record

    dictByPKey.put(pkey, Buff);

    SortedMap<CFAstDomainBasePKey, CFAstMajorVersionBuff> subdictPPrjIdx;
    if (dictByPPrjIdx.containsKey(keyPPrjIdx)) {
        subdictPPrjIdx = dictByPPrjIdx.get(keyPPrjIdx);
    } else {
        subdictPPrjIdx = new TreeMap<CFAstDomainBasePKey, CFAstMajorVersionBuff>();
        dictByPPrjIdx.put(keyPPrjIdx, subdictPPrjIdx);
    }
    subdictPPrjIdx.put(pkey, Buff);

    dictByNameIdx.put(keyNameIdx, Buff);

}

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

public void createDomain(CFAccAuthorization Authorization, CFAccDomainBuff Buff) {
    schema.getTableDomainBase().createDomainBase(Authorization, Buff);
    CFAccDomainBasePKey pkey = schema.getFactoryDomainBase().newPKey();
    pkey.setClassCode(Buff.getClassCode());
    pkey.setRequiredTenantId(Buff.getRequiredTenantId());
    pkey.setRequiredId(Buff.getRequiredId());
    CFAccDomainBySubDomIdxKey keySubDomIdx = schema.getFactoryDomain().newSubDomIdxKey();
    keySubDomIdx.setRequiredTenantId(Buff.getRequiredTenantId());
    keySubDomIdx.setRequiredSubDomainOfId(Buff.getRequiredSubDomainOfId());

    CFAccDomainByNameIdxKey keyNameIdx = schema.getFactoryDomain().newNameIdxKey();
    keyNameIdx.setRequiredTenantId(Buff.getRequiredTenantId());
    keyNameIdx.setRequiredSubDomainOfId(Buff.getRequiredSubDomainOfId());
    keyNameIdx.setRequiredName(Buff.getRequiredName());

    // Validate unique indexes

    if (dictByPKey.containsKey(pkey)) {
        throw CFLib.getDefaultExceptionFactory().newPrimaryKeyNotNewException(getClass(), "createDomain", pkey);
    }//ww  w.  j a  v a2  s  .c  o m

    if (dictByNameIdx.containsKey(keyNameIdx)) {
        throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), "createDomain",
                "DomainNameIdx", keyNameIdx);
    }

    // Validate foreign keys

    {
        boolean allNull = true;
        allNull = false;
        allNull = false;
        if (!allNull) {
            if (null == schema.getTableDomainBase().readDerivedByIdIdx(Authorization,
                    Buff.getRequiredTenantId(), Buff.getRequiredId())) {
                throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                        "createDomain", "Superclass", "SuperClass", "DomainBase", null);
            }
        }
    }

    {
        boolean allNull = true;
        allNull = false;
        allNull = false;
        if (!allNull) {
            if (null == schema.getTableDomainBase().readDerivedByIdIdx(Authorization,
                    Buff.getRequiredTenantId(), Buff.getRequiredSubDomainOfId())) {
                throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                        "createDomain", "Container", "ParentDomain", "DomainBase", null);
            }
        }
    }

    // Proceed with adding the new record

    dictByPKey.put(pkey, Buff);

    SortedMap<CFAccDomainBasePKey, CFAccDomainBuff> subdictSubDomIdx;
    if (dictBySubDomIdx.containsKey(keySubDomIdx)) {
        subdictSubDomIdx = dictBySubDomIdx.get(keySubDomIdx);
    } else {
        subdictSubDomIdx = new TreeMap<CFAccDomainBasePKey, CFAccDomainBuff>();
        dictBySubDomIdx.put(keySubDomIdx, subdictSubDomIdx);
    }
    subdictSubDomIdx.put(pkey, Buff);

    dictByNameIdx.put(keyNameIdx, Buff);

}

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

public void createDomain(CFAstAuthorization Authorization, CFAstDomainBuff Buff) {
    schema.getTableDomainBase().createDomainBase(Authorization, Buff);
    CFAstDomainBasePKey pkey = schema.getFactoryDomainBase().newPKey();
    pkey.setClassCode(Buff.getClassCode());
    pkey.setRequiredTenantId(Buff.getRequiredTenantId());
    pkey.setRequiredId(Buff.getRequiredId());
    CFAstDomainBySubDomIdxKey keySubDomIdx = schema.getFactoryDomain().newSubDomIdxKey();
    keySubDomIdx.setRequiredTenantId(Buff.getRequiredTenantId());
    keySubDomIdx.setRequiredSubDomainOfId(Buff.getRequiredSubDomainOfId());

    CFAstDomainByNameIdxKey keyNameIdx = schema.getFactoryDomain().newNameIdxKey();
    keyNameIdx.setRequiredTenantId(Buff.getRequiredTenantId());
    keyNameIdx.setRequiredSubDomainOfId(Buff.getRequiredSubDomainOfId());
    keyNameIdx.setRequiredName(Buff.getRequiredName());

    // Validate unique indexes

    if (dictByPKey.containsKey(pkey)) {
        throw CFLib.getDefaultExceptionFactory().newPrimaryKeyNotNewException(getClass(), "createDomain", pkey);
    }//ww w.jav a  2s.  c  om

    if (dictByNameIdx.containsKey(keyNameIdx)) {
        throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), "createDomain",
                "DomainNameIdx", keyNameIdx);
    }

    // Validate foreign keys

    {
        boolean allNull = true;
        allNull = false;
        allNull = false;
        if (!allNull) {
            if (null == schema.getTableDomainBase().readDerivedByIdIdx(Authorization,
                    Buff.getRequiredTenantId(), Buff.getRequiredId())) {
                throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                        "createDomain", "Superclass", "SuperClass", "DomainBase", null);
            }
        }
    }

    {
        boolean allNull = true;
        allNull = false;
        allNull = false;
        if (!allNull) {
            if (null == schema.getTableDomainBase().readDerivedByIdIdx(Authorization,
                    Buff.getRequiredTenantId(), Buff.getRequiredSubDomainOfId())) {
                throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                        "createDomain", "Container", "ParentDomain", "DomainBase", null);
            }
        }
    }

    // Proceed with adding the new record

    dictByPKey.put(pkey, Buff);

    SortedMap<CFAstDomainBasePKey, CFAstDomainBuff> subdictSubDomIdx;
    if (dictBySubDomIdx.containsKey(keySubDomIdx)) {
        subdictSubDomIdx = dictBySubDomIdx.get(keySubDomIdx);
    } else {
        subdictSubDomIdx = new TreeMap<CFAstDomainBasePKey, CFAstDomainBuff>();
        dictBySubDomIdx.put(keySubDomIdx, subdictSubDomIdx);
    }
    subdictSubDomIdx.put(pkey, Buff);

    dictByNameIdx.put(keyNameIdx, Buff);

}

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

public void createHostNode(CFAccAuthorization Authorization, CFAccHostNodeBuff Buff) {
    CFAccHostNodePKey pkey = schema.getFactoryHostNode().newPKey();
    pkey.setRequiredClusterId(Buff.getRequiredClusterId());
    pkey.setRequiredHostNodeId(((CFAccRamClusterTable) schema.getTableCluster())
            .nextHostNodeIdGen(Authorization, Buff.getRequiredClusterId()));
    Buff.setRequiredClusterId(pkey.getRequiredClusterId());
    Buff.setRequiredHostNodeId(pkey.getRequiredHostNodeId());
    CFAccHostNodeByClusterIdxKey keyClusterIdx = schema.getFactoryHostNode().newClusterIdxKey();
    keyClusterIdx.setRequiredClusterId(Buff.getRequiredClusterId());

    CFAccHostNodeByUDescrIdxKey keyUDescrIdx = schema.getFactoryHostNode().newUDescrIdxKey();
    keyUDescrIdx.setRequiredClusterId(Buff.getRequiredClusterId());
    keyUDescrIdx.setRequiredDescription(Buff.getRequiredDescription());

    CFAccHostNodeByHostNameIdxKey keyHostNameIdx = schema.getFactoryHostNode().newHostNameIdxKey();
    keyHostNameIdx.setRequiredClusterId(Buff.getRequiredClusterId());
    keyHostNameIdx.setRequiredHostName(Buff.getRequiredHostName());

    // Validate unique indexes

    if (dictByPKey.containsKey(pkey)) {
        throw CFLib.getDefaultExceptionFactory().newPrimaryKeyNotNewException(getClass(), "createHostNode",
                pkey);/* w w  w  .j ava  2  s  .  com*/
    }

    if (dictByUDescrIdx.containsKey(keyUDescrIdx)) {
        throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), "createHostNode",
                "HostNodeUDescrIdx", keyUDescrIdx);
    }

    if (dictByHostNameIdx.containsKey(keyHostNameIdx)) {
        throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), "createHostNode",
                "HostNodeUHostNameIdx", keyHostNameIdx);
    }

    // Validate foreign keys

    {
        boolean allNull = true;
        allNull = false;
        if (!allNull) {
            if (null == schema.getTableCluster().readDerivedByIdIdx(Authorization,
                    Buff.getRequiredClusterId())) {
                throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                        "createHostNode", "Container", "HostNodeCluster", "Cluster", null);
            }
        }
    }

    // Proceed with adding the new record

    dictByPKey.put(pkey, Buff);

    SortedMap<CFAccHostNodePKey, CFAccHostNodeBuff> subdictClusterIdx;
    if (dictByClusterIdx.containsKey(keyClusterIdx)) {
        subdictClusterIdx = dictByClusterIdx.get(keyClusterIdx);
    } else {
        subdictClusterIdx = new TreeMap<CFAccHostNodePKey, CFAccHostNodeBuff>();
        dictByClusterIdx.put(keyClusterIdx, subdictClusterIdx);
    }
    subdictClusterIdx.put(pkey, Buff);

    dictByUDescrIdx.put(keyUDescrIdx, Buff);

    dictByHostNameIdx.put(keyHostNameIdx, Buff);

}