// a RuntimeException - a hack to avoid changing the API all over
// the place
try
{
// get epeople objects
TableRowIterator tri = DatabaseManager.queryTable(myContext,"eperson",
"SELECT eperson.* FROM eperson, epersongroup2eperson WHERE " +
"epersongroup2eperson.eperson_id=eperson.eperson_id AND " +
"epersongroup2eperson.eperson_group_id= ?",
myRow.getIntColumn("eperson_group_id"));
try
{
while (tri.hasNext())
{
TableRow r = (TableRow) tri.next();
// First check the cache
EPerson fromCache = (EPerson) myContext.fromCache(
EPerson.class, r.getIntColumn("eperson_id"));
if (fromCache != null)
{
epeople.add(fromCache);
}
else
{
epeople.add(new EPerson(myContext, r));
}
}
}
finally
{
// close the TableRowIterator to free up resources
if (tri != null)
tri.close();
}
// now get Group objects
tri = DatabaseManager.queryTable(myContext,"epersongroup",
"SELECT epersongroup.* FROM epersongroup, group2group WHERE " +
"group2group.child_id=epersongroup.eperson_group_id AND "+
"group2group.parent_id= ? ",
myRow.getIntColumn("eperson_group_id"));
try
{
while (tri.hasNext())
{
TableRow r = (TableRow) tri.next();
// First check the cache
Group fromCache = (Group) myContext.fromCache(Group.class,
r.getIntColumn("eperson_group_id"));
if (fromCache != null)
{
groups.add(fromCache);
}
else
{
groups.add(new Group(myContext, r));
}
}
}
finally
{
// close the TableRowIterator to free up resources
if (tri != null)
tri.close();
}
}
catch (Exception e)
{