Support trivial delete by key

Currently the SQL backend assumes the full object instance
during the translation routines, so implement deleteKeys
by loading the objects, and then deleting what we found.

Change-Id: Ie1a112551135ad9e2f82b167f5dfefb78e8c07c6
Signed-off-by: Shawn O. Pearce <sop@google.com>
diff --git a/src/main/java/com/google/gwtorm/client/Access.java b/src/main/java/com/google/gwtorm/client/Access.java
index b8d3721..f535aa1 100644
--- a/src/main/java/com/google/gwtorm/client/Access.java
+++ b/src/main/java/com/google/gwtorm/client/Access.java
@@ -161,6 +161,15 @@
   /**
    * Immediately delete existing entities from the data store.
    *
+   * @param keys the keys to delete. The iteration occurs only once.
+   * @throws OrmException data removal failed.
+   * @throws UnsupportedOperationException no PrimaryKey was declared.
+   */
+  void deleteKeys(Iterable<K> keys) throws OrmException;
+
+  /**
+   * Immediately delete existing entities from the data store.
+   *
    * @param instances the instances to delete. The iteration occurs only once.
    * @throws OrmException data removal failed.
    * @throws UnsupportedOperationException no PrimaryKey was declared.
diff --git a/src/main/java/com/google/gwtorm/jdbc/JdbcAccess.java b/src/main/java/com/google/gwtorm/jdbc/JdbcAccess.java
index 4b1c360..e54df99 100644
--- a/src/main/java/com/google/gwtorm/jdbc/JdbcAccess.java
+++ b/src/main/java/com/google/gwtorm/jdbc/JdbcAccess.java
@@ -319,6 +319,11 @@
     });
   }
 
+  @Override
+  public void deleteKeys(Iterable<K> keys) throws OrmException {
+    delete(get(keys));
+  }
+
   private OrmException convertError(final String op, final SQLException err) {
     if (err.getCause() == null && err.getNextException() != null) {
       err.initCause(err.getNextException());