Package com.sleepycat.je

Examples of com.sleepycat.je.SecondaryKeyCreator


    // 单个关键字索引表允许重复的记录
    SecondaryConfig config = new SecondaryConfig();
    config.setAllowCreate(true);
    config.setTransactional(true);
    config.setSortedDuplicates(true);
    config.setKeyCreator(new SecondaryKeyCreator() {

      public boolean createSecondaryKey(SecondaryDatabase secondary,
          DatabaseEntry key, DatabaseEntry data, DatabaseEntry result)
          throws DatabaseException {
        String name = secondary.getDatabaseName();
View Full Code Here


    mySecConfig.setSortedDuplicates(true);

    /*
     * Get a secondary object and set the key creator on it.
     */
    SecondaryKeyCreator firstKeyCreator = new MyFirstKeyCreator();
    mySecConfig.setKeyCreator(firstKeyCreator);
   

    firstKeyIndex = BerkeleyDBFactory.getEnv().openSecondaryDatabase(null,
        "matrix_first_key", db, mySecConfig);
   
    /*
     * Get a secondary object and set the key creator on it.
     */
    SecondaryKeyCreator secondKeyCreator = new MySecondaryKeyCreator();
    mySecConfig.setKeyCreator(secondKeyCreator);
   
    secondKeyIndex = BerkeleyDBFactory.getEnv().openSecondaryDatabase(null,
        "matrix_second_key", db, mySecConfig);
   
View Full Code Here

TOP

Related Classes of com.sleepycat.je.SecondaryKeyCreator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.