Examples of loadOne()


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

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

            session.insert(inst);

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

            Set<UserTypeComposite> actual = inst.getSetCompA();
View Full Code Here

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

            Assert.assertEquals(loaded.getStrSet(), new HashSet<String>(Arrays.asList("one", "two", "three")));
            Assert.assertEquals(loaded.getLazyStrSet(), new HashSet<String>(Arrays.asList("one", "two", "three")));
            Assert.assertEquals(loaded.getStrMap().keySet(), new HashSet<String>(Arrays.asList("one", "two", "three")));
            Assert.assertEquals(loaded.getLazyStrMap().keySet(), new HashSet<String>(Arrays.asList("one", "two", "three")));

            loaded = session.loadOne(LazySimpleEntity.class, 1);

            session.update(loaded);

            Assert.assertNotNull(loaded);
            Assert.assertEquals(loaded.getId(), 1);
View Full Code Here

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

            v = new MapOneValue();
            v.setStr("Ursus");
            inst.put(k2, v);
            session.insert(inst);

            MapOneEntity loaded = session.loadOne(MapOneEntity.class, 11, "pk");
            Assert.assertNotNull(loaded);
            Assert.assertEquals(loaded.getPkInt(), 11);
            Assert.assertEquals(loaded.getPkText(), "pk");
            Assert.assertEquals(loaded.size(), 2);
            v = loaded.get(k1);
View Full Code Here

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

            Assert.assertEquals(loaded.getLazyStrMap().keySet(), new HashSet<String>(Arrays.asList("one", "two", "three")));
            Assert.assertFalse(loaded.getLazyStrList() instanceof LazyList);
            Assert.assertFalse(loaded.getLazyStrSet() instanceof LazySet);
            Assert.assertFalse(loaded.getLazyStrMap() instanceof LazyMap);

            loaded = session.loadOne(LazySimpleEntity.class, 1);

            Assert.assertNotNull(loaded);
            Assert.assertEquals(loaded.getId(), 1);
            Assert.assertNotNull(loaded.getStrList());
            Assert.assertNotNull(loaded.getStrSet());
View Full Code Here

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

            inst.getMapCompA().put(buildComposite("array#3", 3), "str#3");
            inst.getMapCompA().put(buildComposite("array#4", 4), "str#4");

            session.insert(inst);

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

            assertMapUT(inst.getMapCompA(), loaded.getMapCompA());
View Full Code Here

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

            inst.setPkText("pk");
            inst.put("key", ByteBuffer.wrap("hello world".getBytes()));
            inst.put("dog", ByteBuffer.wrap("Ursus".getBytes()));
            session.insert(inst);

            MapSimpleEntity loaded = session.loadOne(MapSimpleEntity.class, 11, "pk");
            Assert.assertNotNull(loaded);
            Assert.assertEquals(loaded.getPkInt(), 11);
            Assert.assertEquals(loaded.getPkText(), "pk");
            Assert.assertEquals(loaded.size(), 2);
            ByteBuffer v = loaded.get("key");
View Full Code Here

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

            inst.getMapCompA().put("str#3", buildComposite("array#3", 3));
            inst.getMapCompA().put("str#4", buildComposite("array#4", 4));

            session.insert(inst);

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

            assertMapUT(inst.getMapCompA(), loaded.getMapCompA());
View Full Code Here

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

            Assert.assertEquals(loaded.getComposite().getStrSet(), new HashSet<String>(Arrays.asList("one", "two", "three")));
            Assert.assertEquals(loaded.getComposite().getLazyStrSet(), new HashSet<String>(Arrays.asList("one", "two", "three")));
            Assert.assertEquals(loaded.getComposite().getStrMap().keySet(), new HashSet<String>(Arrays.asList("one", "two", "three")));
            Assert.assertEquals(loaded.getComposite().getLazyStrMap().keySet(), new HashSet<String>(Arrays.asList("one", "two", "three")));

            loaded = session.loadOne(LazyCompEntity.class, 1);

            Assert.assertNotNull(loaded);
            Assert.assertEquals(loaded.getId(), 1);
            Assert.assertNotNull(loaded.getComposite().getStrList());
            Assert.assertNotNull(loaded.getComposite().getStrSet());
View Full Code Here

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

            inst.getMapCompA().put(buildComposite("key#3", 3), buildComposite("val#3", 3));
            inst.getMapCompA().put(buildComposite("key#4", 4), buildComposite("val#4", 4));

            session.insert(inst);

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

            assertMapUT(inst.getMapCompA(), loaded.getMapCompA());
View Full Code Here

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

            Assert.assertEquals(loaded.getComposite().getLazyStrMap().keySet(), new HashSet<String>(Arrays.asList("one", "two", "three")));
            Assert.assertFalse(loaded.getComposite().getLazyStrList() instanceof LazyList);
            Assert.assertFalse(loaded.getComposite().getLazyStrSet() instanceof LazySet);
            Assert.assertFalse(loaded.getComposite().getLazyStrMap() instanceof LazyMap);

            loaded = session.loadOne(LazyCompEntity.class, 1);

            Assert.assertNotNull(loaded);
            Assert.assertEquals(loaded.getId(), 1);
            Assert.assertNotNull(loaded.getComposite().getStrList());
            Assert.assertNotNull(loaded.getComposite().getStrSet());
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.