Package org.caffinitas.mapper.core

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


            inst = new IfNotExistsEntity();
            inst.setPk(3);
            inst.setCk(5);
            inst.setValue("1-1-update");
            session.update(inst, PersistOption.ifValue("value", "oldVal"));

            IfNotExistsEntity loaded = session.loadOne(IfNotExistsEntity.class, 3, 5);
            Assert.assertEquals(loaded.getValue(), "1-1-update");
        } finally {session.close();}
    }
View Full Code Here


            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);
            Assert.assertNotNull(loaded.getStrList());
            Assert.assertNotNull(loaded.getStrSet());
View Full Code Here

        PersistenceSession session = persistenceManager.createTrackingSession();
        try {
            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();}
    }
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.