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:
@@ -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
|
||||
* table.
|
||||
|
||||
Reference in New Issue
Block a user