Package org.ofbiz.entity

Examples of org.ofbiz.entity.GenericValue.clone()


            testValue.remove("description");
            fail("Modified an immutable GenericValue");
        } catch (UnsupportedOperationException e) {
        }
        // Test entity value update operation updates the cache
        testValue = (GenericValue) testValue.clone();
        testValue.put("description", "New Testing Type #3");
        testValue.store();
        testValue = delegator.findOne("TestingType", true, "testingTypeId", "TEST-3");
        assertEquals("Retrieved from cache value has the correct description", "New Testing Type #3", testValue.getString("description"));
        // Test entity value remove operation updates the cache
View Full Code Here


        testValue.put("description", "New Testing Type #3");
        testValue.store();
        testValue = delegator.findOne("TestingType", true, "testingTypeId", "TEST-3");
        assertEquals("Retrieved from cache value has the correct description", "New Testing Type #3", testValue.getString("description"));
        // Test entity value remove operation updates the cache
        testValue = (GenericValue) testValue.clone();
        testValue.remove();
        testValue = delegator.findOne("TestingType", true, "testingTypeId", "TEST-3");
        assertEquals("Retrieved from cache value is null", null, testValue);
        // Test entity condition cache
        EntityCondition testCondition = EntityCondition.makeCondition("description", EntityOperator.EQUALS, "Testing Type #2");
View Full Code Here

            testValue.remove("description");
            fail("Modified an immutable GenericValue");
        } catch (UnsupportedOperationException e) {
        }
        // Test entity value create operation updates the cache
        testValue = (GenericValue) testValue.clone();
        testValue.put("testingTypeId", "TEST-9");
        testValue.create();
        testList = delegator.findList("TestingType", testCondition, null, null, null, true);
        assertEquals("Delegator findList returned two values", 2, testList.size());
        // Test entity value update operation updates the cache
View Full Code Here

        testValue.store();
        testList = delegator.findList("TestingType", testCondition, null, null, null, true);
        assertEquals("Delegator findList returned one value", 1, testList.size());
        // Test entity value remove operation updates the cache
        testValue = testList.get(0);
        testValue = (GenericValue) testValue.clone();
        testValue.remove();
        testList = delegator.findList("TestingType", testCondition, null, null, null, true);
        assertEquals("Delegator findList returned empty list", 0, testList.size());
        // Test view entities in the pk cache - updating an entity should clear pk caches for all view entities containing that entity.
        testValue = delegator.create("TestingSubtype", "testingTypeId", "TEST-9", "subtypeDescription", "Testing Subtype #9");
View Full Code Here

        // Confirm member entity appears in the view
        testValue = delegator.findOne("TestingViewPks", true, "testingTypeId", "TEST-9");
        assertEquals("View retrieved from cache has the correct member description", "Testing Subtype #9", testValue.getString("subtypeDescription"));
        testValue = delegator.findOne("TestingSubtype", true, "testingTypeId", "TEST-9");
        // Modify member entity
        testValue = (GenericValue) testValue.clone();
        testValue.put("subtypeDescription", "New Testing Subtype #9");
        testValue.store();
        // Check if cached view contains the modification
        testValue = delegator.findOne("TestingViewPks", true, "testingTypeId", "TEST-9");
        assertEquals("View retrieved from cache has the correct member description", "New Testing Subtype #9", testValue.getString("subtypeDescription"));
View Full Code Here

        GenericValue value = entityCache.get(pk);
        if (value == null) {
            return null;
        } else {
            return (GenericValue) value.clone();
        }
    }

    private int removeFromCache(GenericPK pk) {
        if (pk == null) {
View Full Code Here

        GenericValue value = entityCache.get(pk);
        if (value == null) {
            return null;
        } else {
            return (GenericValue) value.clone();
        }
    }

    private int removeFromCache(GenericPK pk) {
        if (pk == null) {
View Full Code Here

            testValue.remove("description");
            fail("Modified an immutable GenericValue");
        } catch (UnsupportedOperationException e) {
        }
        // Test entity value update operation updates the cache
        testValue = (GenericValue) testValue.clone();
        testValue.put("description", "New Testing Type #3");
        testValue.store();
        testValue = delegator.findOne("TestingType", true, "testingTypeId", "TEST-3");
        assertEquals("Retrieved from cache value has the correct description", "New Testing Type #3", testValue.getString("description"));
        // Test entity value remove operation updates the cache
View Full Code Here

        testValue.put("description", "New Testing Type #3");
        testValue.store();
        testValue = delegator.findOne("TestingType", true, "testingTypeId", "TEST-3");
        assertEquals("Retrieved from cache value has the correct description", "New Testing Type #3", testValue.getString("description"));
        // Test entity value remove operation updates the cache
        testValue = (GenericValue) testValue.clone();
        testValue.remove();
        testValue = delegator.findOne("TestingType", true, "testingTypeId", "TEST-3");
        assertEquals("Retrieved from cache value is null", null, testValue);
        // Test entity condition cache
        EntityCondition testCondition = EntityCondition.makeCondition("description", EntityOperator.EQUALS, "Testing Type #2");
View Full Code Here

            testValue.remove("description");
            fail("Modified an immutable GenericValue");
        } catch (UnsupportedOperationException e) {
        }
        // Test entity value create operation updates the cache
        testValue = (GenericValue) testValue.clone();
        testValue.put("testingTypeId", "TEST-9");
        testValue.create();
        testList = delegator.findList("TestingType", testCondition, null, null, null, true);
        assertEquals("Delegator findList returned two values", 2, testList.size());
        // Test entity value update operation updates the cache
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.