Added warnedUpdate to the SimpleRepository

git-svn-id: https://samskivert.googlecode.com/svn/trunk@2075 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
mjohnson
2007-03-21 23:00:21 +00:00
parent e038506fc5
commit 927d8c3336
@@ -311,6 +311,29 @@ public class SimpleRepository extends Repository
}); });
} }
/**
* Executes the supplied update query in this repository, logging a warning
* if the modification count is not equal to the specified count.
*/
protected void warnedUpdate (final String query, final int count)
throws PersistenceException
{
executeUpdate(new Operation<Object>() {
public Object invoke (Connection conn, DatabaseLiaison liaison)
throws SQLException, PersistenceException
{
Statement stmt = null;
try {
stmt = conn.createStatement();
JDBCUtil.warnedUpdate(stmt, query, 1);
} finally {
JDBCUtil.close(stmt);
}
return null;
}
});
}
/** /**
* Instructs MySQL to perform table maintenance on the specified * Instructs MySQL to perform table maintenance on the specified
* table. * table.