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


Java Mutations.addConverter方法代码示例

本文整理汇总了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);
}
 
开发者ID:nologic,项目名称:nabs,代码行数:17,代码来源:ConvertAndAddTest.java

示例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;
}
 
开发者ID:nologic,项目名称:nabs,代码行数:24,代码来源:EvolveClasses.java


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