You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@empire-db.apache.org by re...@apache.org on 2008/09/26 13:00:22 UTC
svn commit: r699266 -
/incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBRecord.java
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;
+ }
+ }
}
/**