*/
protected Collection<T> getCollection(OrderCriteria<T> orderCriteria)
throws OrderException {
if (orderCriteria == null) {
String error = "Order criteria cannot be null.";
throw new OrderException(error);
}
Collection<T> result = new ArrayList<T>();
String propertyCode = orderCriteria.getPropertyCode();
boolean ascending = orderCriteria.isAscending();
Comparator<T> specificComparator = orderCriteria
.getEntityComparator();
Sorter<T> sorter = new Sorter<T>();
if (specificComparator == null) {
if (propertyCode == null) {
String error = "Order criteria property code cannot be null.";
throw new OrderException(error);
}
if (ascending) {
result = sorter.sort(getList(), propertyCode, true);
} else {
result = sorter.sort(getList(), propertyCode, false);