From 1cab976a7d00893fa9db8718480434b97e71a095 Mon Sep 17 00:00:00 2001 From: mdb Date: Wed, 8 Jun 2005 23:14:32 +0000 Subject: [PATCH] I've got the fever, I can't stop making the repositories more convenient. git-svn-id: https://samskivert.googlecode.com/svn/trunk@1654 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- .../java/com/samskivert/jdbc/SimpleRepository.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/projects/samskivert/src/java/com/samskivert/jdbc/SimpleRepository.java b/projects/samskivert/src/java/com/samskivert/jdbc/SimpleRepository.java index 2bda4760..e9c14658 100644 --- a/projects/samskivert/src/java/com/samskivert/jdbc/SimpleRepository.java +++ b/projects/samskivert/src/java/com/samskivert/jdbc/SimpleRepository.java @@ -198,26 +198,26 @@ public class SimpleRepository extends Repository } /** - * Executes the supplied update query in this repository, ignoring the - * return value. + * Executes the supplied update query in this repository, returning + * the number of rows modified. */ - protected void update (final String query) + protected int update (final String query) throws PersistenceException { - execute(new Operation() { + Integer rv = (Integer)execute(new Operation() { public Object invoke (Connection conn, DatabaseLiaison liaison) throws SQLException, PersistenceException { Statement stmt = null; try { stmt = conn.createStatement(); - stmt.executeUpdate(query); + return new Integer(stmt.executeUpdate(query)); } finally { JDBCUtil.close(stmt); } - return null; } }); + return rv.intValue(); } /**