Package com.sleepycat.persist.raw

Examples of com.sleepycat.persist.raw.RawObject


            String compTypeName = expectEvolved ? NAME2 : NAME3;
            String arrayTypeName = "[L" + compTypeName + ';';
            RawType compType = store.getModel().getRawType(compTypeName);
            RawType arrayType = store.getModel().getRawType(arrayTypeName);
            RawObject embed2;
            if (expectEvolved) {
                embed2 = new RawObject
                    (compType, makeValues("data", 88L), null);
            } else {
                embed2 = new RawObject
                    (compType, makeValues("data", 88), null);
            }
            RawObject embed = new RawObject
                (arrayType, new Object[] { embed2 });
            RawObject obj = readRaw(store, 99, NAME, 0, CASECLS, 0);
            checkRawFields(obj, "key", 99, "embed", embed, "embed2", embed2);
        }
View Full Code Here


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

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

            RawObject obj = readRaw
                (store, 99, NAME, expectEvolved ? 1 : 0, CASECLS, 0);
            RawType enumType = store.getModel().getRawType(NAME2);
            if (expectUpdated) {
                checkRawFields(obj, "key", 99,
                               "e1", new RawObject(enumType, "A"),
                               "e2", new RawObject(enumType, "B"),
                               "e3", new RawObject(enumType, "C"));
            } else {
                checkRawFields(obj, "key", 99,
                               "e1", new RawObject(enumType, "A"),
                               "e2", new RawObject(enumType, "B"));
            }
        }
View Full Code Here

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

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

            RawObject obj = readRaw(store, 99, NAME, 0, CASECLS, 0);
            RawType enumType = store.getModel().getRawType(NAME2);
            if (expectEvolved) {
                checkRawFields(obj, "key", 99,
                               "e1", new RawObject(enumType, "A"),
                               "e2", new RawObject(enumType, "C"),
                               "e3", new RawObject(enumType, "C"));
            } else {
                checkRawFields(obj, "key", 99,
                               "e1", new RawObject(enumType, "A"),
                               "e2", new RawObject(enumType, "B"),
                               "e3", new RawObject(enumType, "C"));
            }
        }
View Full Code Here

                TestCase.assertNotNull(newType);
            }

            public Object convert(Object fromValue) {
                TestCase.assertNotNull(newType);
                RawObject obj = (RawObject) fromValue;
                String val = obj.getEnum();
                TestCase.assertNotNull(val);
                if ("B".equals(val)) {
                    val = "C";
                }
                return new RawObject(newType, val);
            }
View Full Code Here

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

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

            RawObject obj = readRaw
                (store, 99, NAME, expectEvolved ? 1 : 0, CASECLS, 0);
            if (expectUpdated) {
                checkRawFields(obj, "key", 99,
                               "addAnnotation", 88,
                               "dropAnnotation", 66,
View Full Code Here

        assertEquals(keyEntry, keyEntry2);

        /* Check raw entity binding. */
        PersistEntityBinding rawEntityBinding =
            new PersistEntityBinding(catalog, entityCls.getName(), true);
        RawObject rawEntity =
            (RawObject) rawEntityBinding.entryToObject(keyEntry, dataEntry);
        rawEntityBinding.objectToKey(rawEntity, keyEntry2);
        rawEntityBinding.objectToData(rawEntity, dataEntry2);
        entity2 = entityBinding.entryToObject(keyEntry2, dataEntry2);
        entity.validate(entity2);
        RawObject rawEntity2 =
            (RawObject) rawEntityBinding.entryToObject(keyEntry2, dataEntry2);
        assertEquals(rawEntity, rawEntity2);
        assertEquals(dataEntry, dataEntry2);
        assertEquals(keyEntry, keyEntry2);

View Full Code Here

            PrimaryIndex<Long,AllowAddSecondary>
                index = newStore.getPrimaryIndex
                    (Long.class,
                     AllowAddSecondary.class);
            RawObject raw = rawStore.getPrimaryIndex(NAME).get(99L);
            index.put((AllowAddSecondary)
                      newStore.getModel().convertRawObject(raw));
        }
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.