Package org.caffinitas.mapper.core

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


            v = new MapSimpleKeyValue();
            v.setValue("Ursus");
            inst.put("dog", v);
            session.insert(inst);

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


            k2.setCkAscii("dog");
            k2.setCkLong(0L);
            inst.put(k2, "Ursus");
            session.insert(inst);

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

            instC.getInhC().put("one", "1");
            instC.getInhC().put("two", "2");
            instC.getInhC().put("three", "3");
            session.insert(instC);

            TpcInheritA loadedA = (TpcInheritA) session.loadOne(TpcBaseEntity.class, 1);
            Assert.assertTrue(loadedA.getInhA() instanceof LazyList);
            Assert.assertEquals(loadedA.getInhA(), Arrays.asList("one", "two", "three"));
            loadedA = session.loadOne(TpcInheritA.class, 1);
            Assert.assertTrue(loadedA.getInhA() instanceof LazyList);
            Assert.assertEquals(loadedA.getInhA(), Arrays.asList("one", "two", "three"));
View Full Code Here

            session.insert(instC);

            TpcInheritA loadedA = (TpcInheritA) session.loadOne(TpcBaseEntity.class, 1);
            Assert.assertTrue(loadedA.getInhA() instanceof LazyList);
            Assert.assertEquals(loadedA.getInhA(), Arrays.asList("one", "two", "three"));
            loadedA = session.loadOne(TpcInheritA.class, 1);
            Assert.assertTrue(loadedA.getInhA() instanceof LazyList);
            Assert.assertEquals(loadedA.getInhA(), Arrays.asList("one", "two", "three"));

            TpcInheritB loadedB = (TpcInheritB) session.loadOne(TpcBaseEntity.class, 2);
            Assert.assertTrue(loadedB.getInhB() instanceof LazySet);
View Full Code Here

            Assert.assertEquals(loadedA.getInhA(), Arrays.asList("one", "two", "three"));
            loadedA = session.loadOne(TpcInheritA.class, 1);
            Assert.assertTrue(loadedA.getInhA() instanceof LazyList);
            Assert.assertEquals(loadedA.getInhA(), Arrays.asList("one", "two", "three"));

            TpcInheritB loadedB = (TpcInheritB) session.loadOne(TpcBaseEntity.class, 2);
            Assert.assertTrue(loadedB.getInhB() instanceof LazySet);
            Assert.assertEquals(loadedB.getInhB(), new HashSet<String>(Arrays.asList("one", "two", "three")));
            loadedB = session.loadOne(TpcInheritB.class, 2);
            Assert.assertTrue(loadedB.getInhB() instanceof LazySet);
            Assert.assertEquals(loadedB.getInhB(), new HashSet<String>(Arrays.asList("one", "two", "three")));
View Full Code Here

            Assert.assertEquals(loadedA.getInhA(), Arrays.asList("one", "two", "three"));

            TpcInheritB loadedB = (TpcInheritB) session.loadOne(TpcBaseEntity.class, 2);
            Assert.assertTrue(loadedB.getInhB() instanceof LazySet);
            Assert.assertEquals(loadedB.getInhB(), new HashSet<String>(Arrays.asList("one", "two", "three")));
            loadedB = session.loadOne(TpcInheritB.class, 2);
            Assert.assertTrue(loadedB.getInhB() instanceof LazySet);
            Assert.assertEquals(loadedB.getInhB(), new HashSet<String>(Arrays.asList("one", "two", "three")));

            TpcInheritB2 loadedB2 = (TpcInheritB2) session.loadOne(TpcBaseEntity.class, 3);
            Assert.assertTrue(loadedB2.getInhB2() instanceof LazyList);
View Full Code Here

            Assert.assertEquals(loadedB.getInhB(), new HashSet<String>(Arrays.asList("one", "two", "three")));
            loadedB = session.loadOne(TpcInheritB.class, 2);
            Assert.assertTrue(loadedB.getInhB() instanceof LazySet);
            Assert.assertEquals(loadedB.getInhB(), new HashSet<String>(Arrays.asList("one", "two", "three")));

            TpcInheritB2 loadedB2 = (TpcInheritB2) session.loadOne(TpcBaseEntity.class, 3);
            Assert.assertTrue(loadedB2.getInhB2() instanceof LazyList);
            Assert.assertEquals(loadedB2.getInhB2(), Arrays.asList("one", "two", "three"));
            loadedB2 = session.loadOne(TpcInheritB2.class, 3);
            Assert.assertTrue(loadedB2.getInhB2() instanceof LazyList);
            Assert.assertEquals(loadedB2.getInhB2(), Arrays.asList("one", "two", "three"));
View Full Code Here

            Assert.assertEquals(loadedB.getInhB(), new HashSet<String>(Arrays.asList("one", "two", "three")));

            TpcInheritB2 loadedB2 = (TpcInheritB2) session.loadOne(TpcBaseEntity.class, 3);
            Assert.assertTrue(loadedB2.getInhB2() instanceof LazyList);
            Assert.assertEquals(loadedB2.getInhB2(), Arrays.asList("one", "two", "three"));
            loadedB2 = session.loadOne(TpcInheritB2.class, 3);
            Assert.assertTrue(loadedB2.getInhB2() instanceof LazyList);
            Assert.assertEquals(loadedB2.getInhB2(), Arrays.asList("one", "two", "three"));

            TpcInheritC loadedC = (TpcInheritC) session.loadOne(TpcBaseEntity.class, 4);
            Assert.assertTrue(loadedC.getInhC() instanceof LazyMap);
View Full Code Here

            Assert.assertEquals(loadedB2.getInhB2(), Arrays.asList("one", "two", "three"));
            loadedB2 = session.loadOne(TpcInheritB2.class, 3);
            Assert.assertTrue(loadedB2.getInhB2() instanceof LazyList);
            Assert.assertEquals(loadedB2.getInhB2(), Arrays.asList("one", "two", "three"));

            TpcInheritC loadedC = (TpcInheritC) session.loadOne(TpcBaseEntity.class, 4);
            Assert.assertTrue(loadedC.getInhC() instanceof LazyMap);
            Assert.assertEquals(loadedC.getInhC().keySet(), new HashSet<String>(Arrays.asList("one", "two", "three")));
            loadedC = session.loadOne(TpcInheritC.class, 4);
            Assert.assertTrue(loadedC.getInhC() instanceof LazyMap);
            Assert.assertEquals(loadedC.getInhC().keySet(), new HashSet<String>(Arrays.asList("one", "two", "three")));
View Full Code Here

            Assert.assertEquals(loadedB2.getInhB2(), Arrays.asList("one", "two", "three"));

            TpcInheritC loadedC = (TpcInheritC) session.loadOne(TpcBaseEntity.class, 4);
            Assert.assertTrue(loadedC.getInhC() instanceof LazyMap);
            Assert.assertEquals(loadedC.getInhC().keySet(), new HashSet<String>(Arrays.asList("one", "two", "three")));
            loadedC = session.loadOne(TpcInheritC.class, 4);
            Assert.assertTrue(loadedC.getInhC() instanceof LazyMap);
            Assert.assertEquals(loadedC.getInhC().keySet(), new HashSet<String>(Arrays.asList("one", "two", "three")));

        }finally {session.close();}
    }
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.