Package org.caffinitas.mapper.test.lazy.tpc

Examples of org.caffinitas.mapper.test.lazy.tpc.TpcInheritB


            TpcInheritA instA = new TpcInheritA();
            instA.setId(1);
            instA.setInhA(Arrays.asList("one", "two", "three"));
            session.insert(instA);

            TpcInheritB instB = new TpcInheritB();
            instB.setId(2);
            instB.setInhB(new HashSet<String>(Arrays.asList("one", "two", "three")));
            session.insert(instB);

            TpcInheritB2 instB2 = new TpcInheritB2();
            instB2.setId(3);
            instB2.setInhB2(Arrays.asList("one", "two", "three"));
            session.insert(instB2);

            TpcInheritC instC = new TpcInheritC();
            instC.setId(4);
            instC.setInhC(new HashMap<String, String>());
            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"));

            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);
            Assert.assertEquals(loadedB2.getInhB2(), Arrays.asList("one", "two", "three"));
            loadedB2 = session.loadOne(TpcInheritB2.class, 3);
View Full Code Here

TOP

Related Classes of org.caffinitas.mapper.test.lazy.tpc.TpcInheritB

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.