From 325630b84ef43b2bcc44e48dbf7b7c3e7acfe1d2 Mon Sep 17 00:00:00 2001 From: mdb Date: Wed, 12 Apr 2006 23:21:18 +0000 Subject: [PATCH] Added loadAll() that supports joining with other tables. git-svn-id: https://samskivert.googlecode.com/svn/trunk@1820 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- .../com/samskivert/jdbc/JORARepository.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/java/com/samskivert/jdbc/JORARepository.java b/src/java/com/samskivert/jdbc/JORARepository.java index 48a3f154..5f599220 100644 --- a/src/java/com/samskivert/jdbc/JORARepository.java +++ b/src/java/com/samskivert/jdbc/JORARepository.java @@ -107,6 +107,24 @@ public abstract class JORARepository extends SimpleRepository }); } + /** + * Loads all objects from the specified table that match the supplied + * query, joining with the supplied auxiliary table(s). + */ + protected ArrayList loadAll ( + final Table table, final String auxtable, final String query) + throws PersistenceException + { + return execute(new Operation>() { + public ArrayList invoke ( + Connection conn, DatabaseLiaison liaison) + throws SQLException, PersistenceException + { + return table.select(query, auxtable).toArrayList(); + } + }); + } + /** * Loads a single object from the specified table that matches the * supplied query. Note: the query should match one or zero