diff --git a/projects/samskivert/src/java/com/samskivert/jdbc/JORARepository.java b/projects/samskivert/src/java/com/samskivert/jdbc/JORARepository.java index 371403b0..df398334 100644 --- a/projects/samskivert/src/java/com/samskivert/jdbc/JORARepository.java +++ b/projects/samskivert/src/java/com/samskivert/jdbc/JORARepository.java @@ -22,6 +22,7 @@ package com.samskivert.jdbc; import java.sql.*; +import com.samskivert.io.PersistenceException; import com.samskivert.jdbc.jora.*; /** @@ -52,6 +53,26 @@ public abstract class JORARepository extends SimpleRepository createTables(_session); } + /** + * Updates the specified field in the supplied object which must + * correspond to the supplied table. + */ + protected void updateField ( + final Table table, final Object object, String field) + throws PersistenceException + { + final FieldMask mask = table.getFieldMask(); + mask.setModified(field); + execute(new Operation() { + public Object invoke (Connection conn, DatabaseLiaison liaison) + throws SQLException, PersistenceException + { + table.update(object, mask); + return null; + } + }); + } + /** * After the database session is begun, this function will be called * to give the repository implementation the opportunity to create its