protected static SlicedFindAll ( |
||
targetType | The target type. | |
firstResult | int | The number of the first row to retrieve. |
maxResults | int | The maximum number of results retrieved. |
orders | NHibernate.Criterion.Order | An |
criteria | DetachedCriteria | The criteria expression |
return |
protected internal static Array SlicedFindAll(Type targetType, int firstResult, int maxResults,
Order[] orders, DetachedCriteria criteria)
{
EnsureInitialized(targetType);
ISession session = holder.CreateSession(targetType);
try
{
ICriteria executableCriteria = criteria.GetExecutableCriteria(session);
AddOrdersToCriteria(executableCriteria, orders);
executableCriteria.SetFirstResult(firstResult);
executableCriteria.SetMaxResults(maxResults);
return SupportingUtils.BuildArray(targetType, executableCriteria.List());
}
catch(ValidationException)
{
holder.FailSession(session);
throw;
}
catch(Exception ex)
{
holder.FailSession(session);
throw new ActiveRecordException("Could not perform SlicedFindAll for " + targetType.Name, ex);
}
finally
{
holder.ReleaseSession(session);
}
}
ActiveRecordBase::SlicedFindAll ( |
|
ActiveRecordBase::SlicedFindAll ( |
|
ActiveRecordBase::SlicedFindAll ( |
public static T[] FindAll(ICriterion[] criterias, Order[] orders, int firstResult, int maxresults) { return((T[])ActiveRecordBase.SlicedFindAll(typeof(T), firstResult, maxresults, orders, criterias)); }