本文整理汇总了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);
}
示例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);
}