protected internal static Array FindAll(Type targetType, Order[] orders, params ICriterion[] criteria)
{
EnsureInitialized(targetType);
ISession session = holder.CreateSession(targetType);
try
{
ICriteria sessionCriteria = session.CreateCriteria(targetType);
foreach(ICriterion cond in criteria)
{
sessionCriteria.Add(cond);
}
AddOrdersToCriteria(sessionCriteria, orders);
return SupportingUtils.BuildArray(targetType, sessionCriteria.List());
}
catch (ValidationException)
{
holder.FailSession(session);
throw;
}
catch (Exception ex)
{
holder.FailSession(session);
throw new ActiveRecordException("Could not perform FindAll for " + targetType.Name, ex);
}
finally
{
holder.ReleaseSession(session);
}
}