本文整理汇总了Java中com.sleepycat.persist.evolve.Mutations.addConverter方法的典型用法代码示例。如果您正苦于以下问题:Java Mutations.addConverter方法的具体用法?Java Mutations.addConverter怎么用?Java Mutations.addConverter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sleepycat.persist.evolve.Mutations
的用法示例。
在下文中一共展示了Mutations.addConverter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: open
import com.sleepycat.persist.evolve.Mutations; //导入方法依赖的package包/类
private EntityStore open(boolean addConverter)
throws DatabaseException {
EnvironmentConfig envConfig = new EnvironmentConfig();
envConfig.setAllowCreate(true);
env = new Environment(envHome, envConfig);
Mutations mutations = new Mutations();
mutations.addConverter(new Converter
(MyEntity.class.getName(), 0, "b", new MyConversion()));
StoreConfig storeConfig = new StoreConfig();
storeConfig.setAllowCreate(true);
storeConfig.setMutations(mutations);
return new EntityStore(env, "foo", storeConfig);
}
示例2: getMutations
import com.sleepycat.persist.evolve.Mutations; //导入方法依赖的package包/类
@Override
Mutations getMutations() {
Mutations m = new Mutations();
m.addRenamer(new Renamer(NAME, 0, "pkeyint", "pkeyInteger"));
m.addRenamer(new Renamer(NAME, 0, "kboolean", "kBoolean"));
m.addRenamer(new Renamer(NAME, 0, "kbyte", "kByte"));
m.addRenamer(new Renamer(NAME, 0, "kshort", "kShort"));
m.addRenamer(new Renamer(NAME, 0, "kint", "kInteger"));
m.addRenamer(new Renamer(NAME, 0, "klong", "kLong"));
m.addRenamer(new Renamer(NAME, 0, "kfloat", "kFloat"));
m.addRenamer(new Renamer(NAME, 0, "kdouble", "kDouble"));
m.addRenamer(new Renamer(NAME, 0, "kchar", "kCharacter"));
m.addRenamer(new Renamer(NAME2, 0, "kcomposite", "kComposite"));
Conversion conv1 = new MyConversion1();
Conversion conv2 = new MyConversion2();
m.addConverter(new Converter(NAME, 0, "f_long2int", conv1));
m.addConverter(new Converter(NAME, 0, "f_String2long", conv2));
m.addConverter(new Converter(NAME2, 0, "f_long2Integer", conv1));
m.addConverter(new Converter(NAME2, 0, "f_String2Long", conv2));
return m;
}