@exception StandardException Standard error policy.
**/
public SortController openSort(long id)
throws StandardException
{
Sort sort;
// Find the sort in the sorts list, throw an error
// if it doesn't exist.
if (sorts == null || id >= sorts.size()
|| (sort = ((Sort) sorts.get((int) id))) == null)
{
throw StandardException.newException(
SQLState.AM_NO_SUCH_SORT, new Long(id));
}
// Open it.
SortController sc = sort.open(this);
// Keep track of it so we can release on close.
if (sortControllers == null)
sortControllers = new ArrayList();
sortControllers.add(sc);