Package org.caffinitas.mapper.core

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


            Assert.assertNotNull(loaded);
            Assert.assertEquals(loaded.getVal(), "1");
            loaded = session.loadOne(BatchCKEntity.class, 1, 2);
            Assert.assertNotNull(loaded);
            Assert.assertEquals(loaded.getVal(), "2");
            loaded = session.loadOne(BatchCKEntity.class, 1, 3);
            Assert.assertNotNull(loaded);
            Assert.assertEquals(loaded.getVal(), "3");
        } finally {session.close();}
    }
View Full Code Here


                inst.setCk(2); // DUPLICATE !!
                inst.setVal("4");
                batch.insert(inst, PersistOption.ifNotExists());
            } finally { batch.close(); // Batch.close() implicitly calls Batch.submitBatch()

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

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

            BatchCKEntity loaded = session.loadOne(BatchCKEntity.class, 11, 1);
            Assert.assertNotNull(loaded);
            Assert.assertEquals(loaded.getVal(), "1");
            loaded = session.loadOne(BatchCKEntity.class, 11, 2);
            Assert.assertNotNull(loaded);
            Assert.assertEquals(loaded.getVal(), "2");
        } finally {session.close();}
    }
View Full Code Here

        try {
            JodaConvertEntity inst = new JodaConvertEntity();
            inst.setId(42);
            session.insert(inst);

            JodaConvertEntity loaded = session.loadOne(JodaConvertEntity.class, 42);
            Assert.assertNotNull(loaded);
            Assert.assertNull(loaded.getDateTime());
            Assert.assertNull(loaded.getLocalDateTime());
            Assert.assertNull(loaded.getLocalDate());
        } finally {session.close();}
View Full Code Here

            inst.setDateTime(dt);
            inst.setLocalDate(ld);
            inst.setLocalDateTime(ldt);
            session.insert(inst);

            JodaConvertEntity loaded = session.loadOne(JodaConvertEntity.class, 99);
            Assert.assertNotNull(loaded);
            Assert.assertNotNull(loaded.getDateTime());
            Assert.assertNotNull(loaded.getLocalDateTime());
            Assert.assertNotNull(loaded.getLocalDate());
            Assert.assertEquals(loaded.getDateTime(), dt);
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.