Package org.caffinitas.mapper.core

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


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

            loaded.setStr("updated");
            session.update(loaded);

            TrackingEntity loaded2 = session.loadOne(TrackingEntity.class, 11);
            Assert.assertSame(loaded2, loaded);
        } finally {session.close();}
    }

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


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

            NoDataColumnsEntity loaded = session.loadOne(NoDataColumnsEntity.class, 11, "foo");

            Assert.assertNotNull(loaded);
            Assert.assertEquals(loaded.getId(), 11);
            Assert.assertEquals(loaded.getStr(), "foo");
View Full Code Here

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

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

            Assert.assertNotNull(loaded);
            Assert.assertEquals(loaded.getId(), 11);
            Assert.assertNotNull(loaded.getStringList());
            Assert.assertNotNull(loaded.getStringSet());
View Full Code Here

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

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

            Assert.assertNotNull(loaded);
            Assert.assertEquals(loaded.getId(), 11);
            Assert.assertNotNull(loaded.getIntEnumMap());
            Assert.assertNotNull(loaded.getStringInetMap());
View Full Code Here

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

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

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

            flatComposite = loaded.getFlatComposite();
View Full Code Here

            inst.setStr("str");
            inst.setOtherFull(refFull);
            inst.setOtherSimple(refSimple);
            session.insert(inst);

            ReferenceEntity loaded = session.loadOne(ReferenceEntity.class, 99);
            Assert.assertEquals(loaded.getId(), 99);
            Assert.assertEquals(loaded.getStr(), "str");
            Assert.assertNull(loaded.getOtherFull());
            Assert.assertNull(loaded.getOtherSimple());
View Full Code Here

            Assert.assertEquals(loaded.getId(), 99);
            Assert.assertEquals(loaded.getStr(), "str");
            Assert.assertNull(loaded.getOtherFull());
            Assert.assertNull(loaded.getOtherSimple());

            loaded = session.loadOne(ReferenceEntity.class, 98);
            Assert.assertEquals(loaded.getId(), 98);
            Assert.assertEquals(loaded.getStr(), "str");

            Assert.assertNotNull(loaded.getOtherSimple());
            Assert.assertEquals(loaded.getOtherSimple().getId(), "idSimple");
View Full Code Here

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

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

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

            inner = loaded.getInner();
View Full Code Here

                inst.setId(3);
                inst.setVal("3");
                batch.insert(inst);
            } finally { batch.close(); } // Batch.close() implicitly calls Batch.submitBatch()

            BatchEntity loaded = session.loadOne(BatchEntity.class, 1);
            Assert.assertNotNull(loaded);
            Assert.assertEquals(loaded.getVal(), "1");
            loaded = session.loadOne(BatchEntity.class, 2);
            Assert.assertNotNull(loaded);
            Assert.assertEquals(loaded.getVal(), "2");
View Full Code Here

            } finally { batch.close(); } // Batch.close() implicitly calls Batch.submitBatch()

            BatchEntity loaded = session.loadOne(BatchEntity.class, 1);
            Assert.assertNotNull(loaded);
            Assert.assertEquals(loaded.getVal(), "1");
            loaded = session.loadOne(BatchEntity.class, 2);
            Assert.assertNotNull(loaded);
            Assert.assertEquals(loaded.getVal(), "2");
            loaded = session.loadOne(BatchEntity.class, 3);
            Assert.assertNotNull(loaded);
            Assert.assertEquals(loaded.getVal(), "3");
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.