Package javax.persistence

Examples of javax.persistence.EntityManager.refresh()


            assert SessionTestHelper.samePermissions(testRole.getPermissions(), resourcePermissions) : "Failed to set resource permissions";

            /* verify role still has global and got all resource permissions */
            Set<Permission> noPermissions = EnumSet.noneOf(Permission.class);
            roleManager.setPermissions(superuser, testRole.getId(), noPermissions);
            em.refresh(testRole);
            assert SessionTestHelper.samePermissions(testRole.getPermissions(), noPermissions) : "Failed to set empty list of permissions";
        } finally {
            getTransactionManager().rollback();
        }
    }
View Full Code Here


            em.persist(c2);

            c2.getProperties().clear();

            em.flush();
            em.refresh(c2);

            assert c1.equals(c1); // matches itself
            assert c1.equals(c2); // null config matches an empty config
            assert c2.equals(c1);
            c1.put(new PropertySimple("one", null));
View Full Code Here

            PropertyList list2 = new PropertyList("listA");
            list2.setList(null);
            c2.put(list2);

            em.flush();
            em.refresh(c2);

            assert c1.equals(c2); // empty list is the same as a null list
            assert c2.equals(c1);

            list1.add(new PropertySimple("x", "y"));
View Full Code Here

            assert !c1.equals(c2);
            assert !c2.equals(c1);

            list2.add(new PropertySimple("x", "y"));
            em.flush();
            em.refresh(c2);
            assert c1.equals(c2);
            assert c2.equals(c1);

            PropertyMap map1 = new PropertyMap("mapB");
            map1.setMap(new HashMap<String, Property>());
View Full Code Here

            c1.put(map1);
            PropertyMap map2 = new PropertyMap("mapB");
            map1.setMap(null);
            c2.put(map2);
            em.flush();
            em.refresh(c2);
            assert c1.equals(c2); // empty map is the same as a null map
            assert c2.equals(c1);

            map1.put(new PropertySimple("m", "n"));
            assert !c1.equals(c2);
View Full Code Here

            assert !c1.equals(c2);
            assert !c2.equals(c1);

            map2.put(new PropertySimple("m", "n"));
            em.flush();
            em.refresh(c2);
            assert c1.equals(c2);
            assert c2.equals(c1);

            map1.put(list1);
            map2.put(list2);
View Full Code Here

            assert c2.equals(c1);

            map1.put(list1);
            map2.put(list2);
            em.flush();
            em.refresh(c2);
            assert c1.equals(c2); // innerList is empty, so its same as a null
            assert c2.equals(c1);
            list1.add(new PropertySimple("x", "z"));
            assert !c1.equals(c2);
            assert !c2.equals(c1);
View Full Code Here

            list1.add(new PropertySimple("x", "z"));
            assert !c1.equals(c2);
            assert !c2.equals(c1);
            list2.add(new PropertySimple("x", "z"));
            em.flush();
            em.refresh(c2);

            assert c1.equals(c2);
            assert c2.equals(c1);

            c1.put(new PropertySimple("n1", ""));
View Full Code Here

            assert c2.equals(c1);

            c1.put(new PropertySimple("n1", ""));
            c2.put(new PropertySimple("n1", ""));
            em.flush();
            em.refresh(c2);
            assert c1.equals(c2);
            assert c2.equals(c1);

            c1.put(new PropertySimple("n1", null));
            c2.put(new PropertySimple("n1", null));
View Full Code Here

            assert c2.equals(c1);

            c1.put(new PropertySimple("n1", null));
            c2.put(new PropertySimple("n1", null));
            em.flush();
            em.refresh(c2);
            assert c1.equals(c2);
            assert c2.equals(c1);
        } finally {
            getTransactionManager().rollback();
        }
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.