Let's get crazy convenient!
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1506 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -54,8 +54,8 @@ public abstract class JORARepository extends SimpleRepository
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the specified field in the supplied object which must
|
||||
* correspond to the supplied table.
|
||||
* 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)
|
||||
@@ -73,6 +73,28 @@ public abstract class JORARepository extends SimpleRepository
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the specified fields in the supplied object (which must
|
||||
* correspond to the supplied table).
|
||||
*/
|
||||
protected void updateFields (
|
||||
final Table table, final Object object, String[] fields)
|
||||
throws PersistenceException
|
||||
{
|
||||
final FieldMask mask = table.getFieldMask();
|
||||
for (int ii = 0; ii < fields.length; ii++) {
|
||||
mask.setModified(fields[ii]);
|
||||
}
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user