Examples of loadOne()


Examples of org.caffinitas.mapper.core.PersistenceSession.loadOne()

                snazy.getOtherAddresses().put(AddressKind.HOME, mainAddress);
                session.insert(snazy);

                // now load the user object

                UserEntity loaded = session.loadOne(UserEntity.class, "snazy");
                System.out.printf("got user record for %s %n", loaded.getUsername());

                //
                //
                //
View Full Code Here

Examples of org.caffinitas.mapper.core.PersistenceSession.loadOne()

                        moduleCorePersistFuture, moduleDemoPersistFuture, moduleTestPersistFuture);
                Uninterruptibles.getUninterruptibly(combinedFuture);

                //

                project = session.loadOne(ProjectEntity.class, project.getId());

                // load all modules (since projectId is the partition key in ModuleEntity we can load it with one SELECT)
                List<ModuleEntity> modules = session.loadMultiple(ModuleEntity.class, project.getId());

                for (ModuleEntity module : modules)
View Full Code Here

Examples of org.caffinitas.mapper.core.PersistenceSession.loadOne()

            Assert.assertTrue(modifyWrapResultSet.get());

            beginModify.set(false);
            modifyWrapResultSet.set(false);

            session.loadOne(SimpleEntity.class, 1);

            Assert.assertFalse(beginModify.get());
            Assert.assertTrue(beginQuery.get());
            Assert.assertTrue(readResultSetBegin.get());
            Assert.assertTrue(readResultSetRow.get());
View Full Code Here

Examples of org.caffinitas.mapper.core.PersistenceSession.loadOne()

            ReferencedEntity inst = new ReferencedEntity();
            inst.setId(1);
            inst.setVal("1");
            session.insert(inst);

            ReferencedEntity loaded = session.loadOne(ReferencedEntity.class, 1);
            Assert.assertNotNull(loaded);
            Assert.assertEquals(loaded.getVal(), "1");

            NextFlatComposite compNext = new NextFlatComposite();
            compNext.setTs(new Date());
View Full Code Here

Examples of org.caffinitas.mapper.core.PersistenceSession.loadOne()

            ref.setSomeComposite(comp);
            ref.setCompB(compB);

            session.insert(ref);

            ReferencingEntity l = session.loadOne(ReferencingEntity.class, 2);
            Assert.assertEquals(l.getId(), 2);
            Assert.assertEquals(l.getVal(), "v2");
            Assert.assertNotNull(l.getReferencedEntity());
            Assert.assertEquals(l.getReferencedEntity().getId(), 1);
            Assert.assertEquals(l.getReferencedEntity().getVal(), "1");
View Full Code Here

Examples of org.caffinitas.mapper.core.PersistenceSession.loadOne()

            comp.setStr("string");
            comp.setNum(42);
            inst.setComp(comp);
            session.insert(inst);

            TupleEntity loaded = session.loadOne(TupleEntity.class, 11);
            Assert.assertNotNull(loaded);
            Assert.assertNotNull(loaded.getComp());
            Assert.assertEquals(loaded.getComp().getNum(), 42);
            Assert.assertEquals(loaded.getComp().getStr(), "string");
        } finally {session.close();}
View Full Code Here

Examples of org.caffinitas.mapper.core.PersistenceSession.loadOne()

            dyn.addUtf8String("Ursus");
            dyn.addInt(42);
            inst.setDyn(dyn);
            session.insert(inst);

            DynamicCompEntity loaded = session.loadOne(DynamicCompEntity.class, 11);
            Assert.assertNotNull(loaded);
            dyn = loaded.getDyn();
            Assert.assertNotNull(dyn);
            Assert.assertEquals(dyn.size(), 3);
            Assert.assertEquals(dyn.getType(0), DataType.cboolean());
View Full Code Here

Examples of org.caffinitas.mapper.core.PersistenceSession.loadOne()

            inst.setPk(3);
            inst.setCk(5);
            inst.setValue("1-1-update");
            session.update(inst, PersistOption.ifValue("value", "oldVal"));

            IfNotExistsEntity loaded = session.loadOne(IfNotExistsEntity.class, 3, 5);
            Assert.assertEquals(loaded.getValue(), "1-1-update");
        } finally {session.close();}
    }

    @Test(dependsOnMethods = "insert_if_not_exists_fail")
View Full Code Here

Examples of org.caffinitas.mapper.core.PersistenceSession.loadOne()

        PersistenceSession session = persistenceManager.createSession();
        try {
            session.insert(inst);

            UserTypeCompEntity loaded = session.loadOne(UserTypeCompEntity.class, 11);

            Assert.assertNotNull(loaded);
            Assert.assertEquals(loaded.getId(), 11);

            utComposite = loaded.getUserTypeComposite();
View Full Code Here

Examples of org.caffinitas.mapper.core.PersistenceSession.loadOne()

                buildComposite("array#4", 4)
            ));

            session.insert(inst);

            UserTypeCompInListEntity loaded = session.loadOne(UserTypeCompInListEntity.class, 11);
            Assert.assertNotNull(loaded);
            comp = loaded.getCompB();
            assertUT(comp, "some string value", 42);

            List<UserTypeComposite> actual = inst.getListCompA();
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.