Added loadAll() that supports joining with other tables.

git-svn-id: https://samskivert.googlecode.com/svn/trunk@1820 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
mdb
2006-04-12 23:21:18 +00:00
parent a7f04bb8b0
commit 325630b84e
@@ -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 <T> ArrayList<T> loadAll (
final Table<T> table, final String auxtable, final String query)
throws PersistenceException
{
return execute(new Operation<ArrayList<T>>() {
public ArrayList<T> 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. <em>Note:</em> the query should match one or zero