Route dirty marking through a method. We'll skip the whold FieldMask business

elsewhere.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2570 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
samskivert
2009-06-04 21:20:45 +00:00
parent 816939e1e2
commit ed70c50606
+21 -13
View File
@@ -64,7 +64,7 @@ public class User
public void setRealName (String realname)
{
this.realname = realname;
_dirty.setModified("realname");
setModified("realname");
}
/**
@@ -85,7 +85,7 @@ public class User
public void setPassword (Password password)
{
this.password = password.getEncrypted();
_dirty.setModified("password");
setModified("password");
}
/**
@@ -94,7 +94,7 @@ public class User
public void setEmail (String email)
{
this.email = email;
_dirty.setModified("email");
setModified("email");
}
/**
@@ -103,7 +103,7 @@ public class User
public void setSiteId (int siteId)
{
this.siteId = siteId;
_dirty.setModified("siteId");
setModified("siteId");
}
/**
@@ -154,21 +154,21 @@ public class User
return false;
}
/**
* Called by the repository to find out which fields have been modified since the object was
* loaded.
*/
public FieldMask getDirtyMask ()
{
return _dirty;
}
@Override // from Object
public String toString ()
{
return StringUtil.fieldsToString(this);
}
/**
* Called by the repository to find out which fields have been modified since the object was
* loaded.
*/
protected FieldMask getDirtyMask ()
{
return _dirty;
}
/**
* Called by the repository to configure this user record with a field mask that it can use to
* track modified fields.
@@ -178,6 +178,14 @@ public class User
_dirty = dirty;
}
/**
* Marks the supplied field as dirty.
*/
protected void setModified (String field)
{
_dirty.setModified(field);
}
/** Our dirty field mask. */
protected transient FieldMask _dirty;
}