Examples of RawObject


Examples of com.sleepycat.persist.raw.RawObject

            throws DatabaseException {

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

Examples of com.sleepycat.persist.raw.RawObject

            throws DatabaseException {

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

Examples of com.sleepycat.persist.raw.RawObject

            throws DatabaseException {

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

Examples of com.sleepycat.persist.raw.RawObject

    @Override
    public Object newInstance(EntityInput input, boolean rawAccess) {
        int index = input.readEnumConstant(names);
        if (rawAccess) {
            return new RawObject(this, names[index]);
        } else {
            return values[index];
        }
    }
View Full Code Here

Examples of com.sleepycat.persist.raw.RawObject

        this.objects = objects;
    }

    @Override
    Object readNext() {
        RawObject raw = objects[index];
        FieldInfo field = fields[index];
        index += 1;
        Format format = field.getType();
        Object o = raw.getValues().get(field.getName());
        return checkAndConvert(o, format);
    }
View Full Code Here

Examples of com.sleepycat.persist.raw.RawObject

            }

            RawType embedType = store.getModel().getRawType(NAME);
            checkRawType(embedType, NAME, 0);

            RawObject embed =
                new RawObject(embedType, makeValues("f", 123), null);

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

Examples of com.sleepycat.persist.raw.RawObject

                (ConvertExample3_Address.class.getName());
        }

        public Object convert(Object fromValue) {

            RawObject person = (RawObject) fromValue;
            Map<String,Object> personValues = person.getValues();
            Map<String,Object> addressValues = new HashMap<String,Object>();
            RawObject address = new RawObject
                (addressType, addressValues, null);

            addressValues.put("street", personValues.remove("street"));
            addressValues.put("city", personValues.remove("city"));
            addressValues.put("state", personValues.remove("state"));
            addressValues.put("zipCode", personValues.remove("zipCode"));
            personValues.put("address", address);

            return new RawObject
                (newPersonType, personValues, person.getSuper());
        }
View Full Code Here

Examples of com.sleepycat.persist.raw.RawObject

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

Examples of com.sleepycat.persist.raw.RawObject

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

            RawObject obj = readRaw
                (store, 99, NAME, expectEvolved ? 1 : 0, CASECLS, 0);
            if (expectEvolved) {
                RawType embedType = store.getModel().getRawType(NAME2);
                Object embed = new RawObject
                    (embedType,
                     makeValues("street", "street",
                                "city", "city",
                                "state", "state",
                                "zipCode", 12345),
View Full Code Here

Examples of com.sleepycat.persist.raw.RawObject

            newAType = model.getRawType(ConvertExample4_A.class.getName());
            newBType = model.getRawType(ConvertExample4_B.class.getName());
        }

        public Object convert(Object fromValue) {
            RawObject oldA = (RawObject) fromValue;
            RawObject oldB = oldA.getSuper();
            Map<String,Object> aValues = oldA.getValues();
            Map<String,Object> bValues = oldB.getValues();
            bValues.put("name", aValues.remove("name"));
            RawObject newB = new RawObject(newBType, bValues, oldB.getSuper());
            RawObject newA = new RawObject(newAType, aValues, newB);
            return newA;
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.