Package com.sleepycat.persist.raw

Examples of com.sleepycat.persist.raw.RawObject


        }
        return rawObj.getElements();
    }

    static void setElements(RawObject collection, Object[] elements) {
        RawObject value = null;
        while (value == null && collection != null) {
            Map<String,Object> values = collection.getValues();
            if (values != null) {
                value = (RawObject) values.get("elements");
                if (value != null) {
                    values.put("elements",
                               new RawObject(value.getType(), elements));
                } else {
                    collection = collection.getSuper();
                }
            }
        }
View Full Code Here


            PrimaryIndex<Integer,InsertSuperclass1_Between>
                index = newStore.getPrimaryIndex
                    (Integer.class,
                     InsertSuperclass1_Between.class);
            RawObject raw = rawStore.getPrimaryIndex(NAME2).get(99);
            index.put((InsertSuperclass1_Between)
                      newStore.getModel().convertRawObject(raw));
        }
View Full Code Here

                             Set results) {
        /*
         * This could be optimized by traversing the byte format of the
         * collection's elements array.
         */
        RawObject collection = (RawObject) format.newInstance(input, true);
        collection = (RawObject) format.readObject(collection, input, true);
        Object[] elements = getElements(collection);
        if (elements != null) {
            for (Object elem : elements) {
                RecordOutput output =
View Full Code Here

        void readRawObjects(RawStore store,
                            boolean expectEvolved,
                            boolean expectUpdated)
            throws DatabaseException {

            RawObject obj;
            if (expectEvolved) {
                obj = readRaw(store, 99, NAME2, 1, NAME, 0, CASECLS, 0);
            } else {
                obj = readRaw(store, 99, NAME2, 0, CASECLS, 0);
            }
            checkRawFields(obj, "key", 99, "ff", 88);
            if (expectEvolved) {
                if (expectUpdated) {
                    checkRawFields(obj.getSuper(), "f", 123);
                } else {
                    checkRawFields(obj.getSuper());
                }
                checkRawFields(obj.getSuper().getSuper());
                TestCase.assertNull(obj.getSuper().getSuper().getSuper());
            } else {
                checkRawFields(obj.getSuper());
                TestCase.assertNull(obj.getSuper().getSuper());
            }
        }
View Full Code Here

            PrimaryIndex<Integer,InsertSuperclass2_Top>
                index = newStore.getPrimaryIndex
                    (Integer.class,
                     InsertSuperclass2_Top.class);
            RawObject raw = rawStore.getPrimaryIndex(NAME).get(99);
            index.put((InsertSuperclass2_Top)
                      newStore.getModel().convertRawObject(raw));
        }
View Full Code Here

                            boolean expectEvolved,
                            boolean expectUpdated)
            throws DatabaseException {

            RawType embedType = store.getModel().getRawType(NAME2);
            RawObject embedSuper = null;
            if (expectEvolved) {
                RawType embedSuperType = store.getModel().getRawType(NAME3);
                Map<String,Object> values =
                    expectUpdated ? makeValues("g", 456) : makeValues();
                embedSuper = new RawObject(embedSuperType, values, null);
            }
            RawObject embed =
                new RawObject(embedType, makeValues("f", 123), embedSuper);
            RawObject obj = readRaw(store, 99, NAME, 0, CASECLS, 0);
            checkRawFields(obj, "key", 99, "ff", 88, "embed", embed);
        }
View Full Code Here

            throws DatabaseException {

            if (expectEvolved) {
                TestCase.fail();
            }
            RawObject obj = readRaw(store, 99, NAME, 0, CASECLS, 0);
            checkRawFields(obj, "key", 99, "ff", 88);
        }
View Full Code Here

                                     DatabaseEntry data,
                                     DatabaseEntry secKey)
  throws DatabaseException {

        /* Deserialize the entity and get its current class format. */
        RawObject entity = (RawObject) PersistEntityBinding.readEntity
            (catalog, key, data, true /*rawAccess*/);
        Format entityFormat = (Format) entity.getType();

        /*
         * Set the key to null.  For a TO_MANY key, pass the key object to be
         * removed from the array/collection.
         */
 
View Full Code Here

            throws DatabaseException {

            if (expectEvolved) {
                TestCase.fail();
            }
            RawObject obj = readRaw(store, 99, NAME, 0, CASECLS, 0);
            checkRawFields(obj, "key", 99, "ff", "88");
        }
View Full Code Here

            if (expectEvolved) {
                TestCase.fail();
            }
            RawType embedType = store.getModel().getRawType
                (MyType.class.getName());
            RawObject embed = new RawObject(embedType, makeValues(), null);

            RawObject obj = readRaw(store, 99, NAME, 0, CASECLS, 0);
            checkRawFields(obj, "key", 99, "ff", embed);
        }
View Full Code Here

TOP

Related Classes of com.sleepycat.persist.raw.RawObject

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.