当前位置: 首页>>代码示例>>Java>>正文


Java SecondaryConfig.getBtreeComparator方法代码示例

本文整理汇总了Java中com.sleepycat.je.SecondaryConfig.getBtreeComparator方法的典型用法代码示例。如果您正苦于以下问题:Java SecondaryConfig.getBtreeComparator方法的具体用法?Java SecondaryConfig.getBtreeComparator怎么用?Java SecondaryConfig.getBtreeComparator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.sleepycat.je.SecondaryConfig的用法示例。


在下文中一共展示了SecondaryConfig.getBtreeComparator方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setSecondaryConfig

import com.sleepycat.je.SecondaryConfig; //导入方法依赖的package包/类
public synchronized void setSecondaryConfig(Class entityClass,
                                            String keyName,
                                            SecondaryConfig config) {
    checkOpen();
    String entityClsName = entityClass.getName();
    EntityMetadata entityMeta = checkEntityClass(entityClsName);
    SecondaryKeyMetadata secKeyMeta = checkSecKey(entityMeta, keyName);
    String keyClassName = getSecKeyClass(secKeyMeta);
    String secName = makeSecName(entityClass.getName(), keyName);
    if (secIndexMap.containsKey(secName)) {
        throw new IllegalStateException
            ("Cannot set config after DB is open");
    }
    SecondaryConfig dbConfig =
        getSecondaryConfig(secName, entityMeta, keyClassName, secKeyMeta);
    if (config.getSortedDuplicates() != dbConfig.getSortedDuplicates() ||
        config.getBtreeComparator() != dbConfig.getBtreeComparator() ||
        config.getDuplicateComparator() != null ||
        config.getAllowPopulate() != dbConfig.getAllowPopulate() ||
        config.getKeyCreator() != dbConfig.getKeyCreator() ||
        config.getMultiKeyCreator() != dbConfig.getMultiKeyCreator() ||
        config.getForeignKeyNullifier() !=
            dbConfig.getForeignKeyNullifier() ||
        config.getForeignMultiKeyNullifier() !=
            dbConfig.getForeignMultiKeyNullifier() ||
        config.getForeignKeyDeleteAction() !=
            dbConfig.getForeignKeyDeleteAction() ||
        config.getForeignKeyDatabase() != null) {
        throw new IllegalArgumentException
            ("One of these properties was illegally changed: " +
             " SortedDuplicates, BtreeComparator, DuplicateComparator," +
             " AllowPopulate, KeyCreator, MultiKeyCreator," +
             " ForeignKeyNullifer, ForeignMultiKeyNullifier," +
             " ForeignKeyDeleteAction, ForeignKeyDatabase");
    }
    secConfigMap.put(secName, config);
}
 
开发者ID:nologic,项目名称:nabs,代码行数:38,代码来源:Store.java

示例2: setSecondaryConfig

import com.sleepycat.je.SecondaryConfig; //导入方法依赖的package包/类
public synchronized void setSecondaryConfig(Class entityClass,
                                            String keyName,
                                            SecondaryConfig config) {
    checkOpen();
    String entityClsName = entityClass.getName();
    EntityMetadata entityMeta = checkEntityClass(entityClsName);
    SecondaryKeyMetadata secKeyMeta = checkSecKey(entityMeta, keyName);
    String keyClassName = getSecKeyClass(secKeyMeta);
    String secName = makeSecName(entityClass.getName(), keyName);
    if (secIndexMap.containsKey(secName)) {
        throw new IllegalStateException
            ("Cannot set config after DB is open");
    }
    SecondaryConfig dbConfig =
        getSecondaryConfig(secName, entityMeta, keyClassName, secKeyMeta);
    if (config.getExclusiveCreate() ||
        config.getAllowCreate() == config.getReadOnly() ||
        config.getSortedDuplicates() != dbConfig.getSortedDuplicates() ||
        config.getBtreeComparator() != dbConfig.getBtreeComparator() ||
        config.getDuplicateComparator() != null ||
        /* <!-- begin JE only --> */
        config.getTemporary() != dbConfig.getTemporary() ||
        /* <!-- end JE only --> */
        config.getAllowPopulate() != dbConfig.getAllowPopulate() ||
        config.getKeyCreator() != dbConfig.getKeyCreator() ||
        config.getMultiKeyCreator() != dbConfig.getMultiKeyCreator() ||
        config.getForeignKeyNullifier() !=
            dbConfig.getForeignKeyNullifier() ||
        config.getForeignMultiKeyNullifier() !=
            dbConfig.getForeignMultiKeyNullifier() ||
        config.getForeignKeyDeleteAction() !=
            dbConfig.getForeignKeyDeleteAction() ||
        config.getForeignKeyDatabase() != null) {
        throw new IllegalArgumentException
            ("One of these properties was illegally changed: " +
             " AllowCreate, ExclusiveCreate, SortedDuplicates," +
             " BtreeComparator, DuplicateComparator, Temporary," +
             " AllowPopulate, KeyCreator, MultiKeyCreator," +
             " ForeignKeyNullifer, ForeignMultiKeyNullifier," +
             " ForeignKeyDeleteAction, ForeignKeyDatabase");
    }
    if (!DbCompat.isTypeBtree(config)) {
        throw new IllegalArgumentException("Only type BTREE allowed");
    }
    secConfigMap.put(secName, config);
}
 
开发者ID:prat0318,项目名称:dbms,代码行数:47,代码来源:Store.java


注:本文中的com.sleepycat.je.SecondaryConfig.getBtreeComparator方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。