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:
@@ -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
|
* Loads a single object from the specified table that matches the
|
||||||
* supplied query. <em>Note:</em> the query should match one or zero
|
* supplied query. <em>Note:</em> the query should match one or zero
|
||||||
|
|||||||
Reference in New Issue
Block a user