empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rei...@apache.org
Subject svn commit: r699266 - /incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBRecord.java
Date Fri, 26 Sep 2008 11:00:22 GMT
Author: reiher
Date: Fri Sep 26 04:00:21 2008
New Revision: 699266

URL: http://svn.apache.org/viewvc?rev=699266&view=rev
Log:
JIRA EMPIREDB-18 fix.

Modified:
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBRecord.java

Modified: incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBRecord.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBRecord.java?rev=699266&r1=699265&r2=699266&view=diff
==============================================================================
--- incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBRecord.java (original)
+++ incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBRecord.java Fri Sep
26 04:00:21 2008
@@ -338,7 +338,7 @@
 
     /**
      * Sets the modified state of a column.<BR>
-	 * This will force the field to be updated in the database.
+	 * This will force the field to be updated in the database, if set to TRUE.
      */
     public void setModified(DBColumn column, boolean isModified)
     {
@@ -351,9 +351,25 @@
         int index = getFieldIndex(column);
         if (index >= 0)
             modified[index] = isModified;
-        // Set State
+        // Set State to modified, if not already at least modified and isModified is set
to true
         if (state < REC_MODIFIED && isModified)
             state = REC_MODIFIED;
+        // Reset state to unmodified, if currently modified and not modified anymore after
the change
+        if (state == REC_MODIFIED && !isModified)
+        {
+        	boolean recordNotModified = true;
+            for (int j = 0; j < fields.length; j++)
+            {
+                if (modified[j] == true)
+                {
+                	recordNotModified = false;
+                }
+            }
+            if (recordNotModified)
+            {
+            	state = REC_VALID;
+            }
+        }
     }
     
     /**



Mime
View raw message