Package com.sleepycat.db

Examples of com.sleepycat.db.SecondaryKeyCreator


        SecondaryKeyMetadata secKeyMeta =
            entityMeta.getSecondaryKeys().get(keyName);
        assertNotNull(secKeyMeta);

        /* Create key creator/nullifier. */
        SecondaryKeyCreator keyCreator = new PersistKeyCreator
            (catalog, entityMeta, keyCls.getName(), secKeyMeta);

        /* Convert entity to bytes. */
        PersistEntityBinding entityBinding =
            new PersistEntityBinding(catalog, entityCls.getName(), false);
        entityBinding.objectToData(entity, dataEntry);
        entityBinding.objectToKey(entity, keyEntry);

        /* Extract secondary key bytes from entity bytes. */
        DatabaseEntry secKeyEntry = new DatabaseEntry();
        boolean isKeyPresent = keyCreator.createSecondaryKey
            (null, keyEntry, dataEntry, secKeyEntry);
        assertEquals(keyValue != null, isKeyPresent);

        /* Convert secondary key bytes back to an object. */
        PersistKeyBinding keyBinding =
View Full Code Here

TOP

Related Classes of com.sleepycat.db.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.