You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ad...@apache.org on 2013/04/23 01:00:47 UTC
svn commit: r1470747 - in
/ofbiz/trunk/framework/entity/src/org/ofbiz/entity: GenericDelegator.java
GenericEntity.java test/EntityTestSuite.java
Author: adrianc
Date: Mon Apr 22 23:00:47 2013
New Revision: 1470747
URL: http://svn.apache.org/r1470747
Log:
JavaDocs and some small fixups for my previous commits.
Modified:
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericEntity.java
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java
Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java?rev=1470747&r1=1470746&r2=1470747&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java Mon Apr 22 23:00:47 2013
@@ -1348,6 +1348,7 @@ public class GenericDelegator implements
}
int retVal = helper.store(value);
+ value.clearChanged();
if (testMode) {
storeForTestRollback(new TestOperation(OperationType.UPDATE, updatedEntity));
Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericEntity.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericEntity.java?rev=1470747&r1=1470746&r2=1470747&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericEntity.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericEntity.java Mon Apr 22 23:00:47 2013
@@ -64,7 +64,9 @@ import org.w3c.dom.Element;
* <p>Note that this class extends <code>Observable</code> to achieve change notification for
* <code>Observer</code>s. Whenever a field changes the name of the field will be passed to
* the <code>notifyObservers()</code> method, and through that to the <code>update()</code> method of each
- * <code>Observer</code>.
+ * <code>Observer</code>.</p>
+ * <p>This class is not thread-safe. If an instance of this class is shared between threads,
+ * then it should be made immutable by calling the <code>setImmutable()</code> method.</p>
*
*/
@SuppressWarnings("serial")
Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java?rev=1470747&r1=1470746&r2=1470747&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java Mon Apr 22 23:00:47 2013
@@ -106,9 +106,11 @@ public class EntityTestSuite extends Ent
observer.arg = null;
GenericValue clonedValue = (GenericValue) testValue.clone();
clonedValue.put("description", "New Testing Type #1");
+ assertTrue("Observable has changed", testValue.hasChanged());
assertEquals("Observer called with cloned GenericValue field name", "description", observer.arg);
// now store it
testValue.store();
+ assertFalse("Observable has not changed", testValue.hasChanged());
// now retrieve it again and make sure that the updated value is correct
testValue = delegator.findOne("TestingType", false, "testingTypeId", "TEST-1");