@@ -0,0 +1,2262 @@
+/*******************************************************************************%0A * OpenCPS is the open source Core Public Services software%0A * Copyright (C) 2016-present OpenCPS community%0A *%0A * This program is free software: you can redistribute it and/or modify%0A * it under the terms of the GNU Affero General Public License as published by%0A * the Free Software Foundation, either version 3 of the License, or%0A * any later version.%0A *%0A * This program is distributed in the hope that it will be useful,%0A * but WITHOUT ANY WARRANTY; without even the implied warranty of%0A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the%0A * GNU Affero General Public License for more details.%0A * You should have received a copy of the GNU Affero General Public License%0A * along with this program. If not, see %3Chttp://www.gnu.org/licenses/%3E.%0A *******************************************************************************/%0A%0Apackage org.opencps.processmgt.util.comparator;%0A%0Aimport org.opencps.processmgt.model.ActionHistory;%0Aimport com.liferay.portal.kernel.util.DateUtil;%0Aimport com.liferay.portal.kernel.util.OrderByComparator;%0A%0A/**%0A * @author trungnt%0A */%0Apublic class ActionHistoryCreateDateComparator extends OrderByComparator %7B%0A%0A%09public static final String ORDER_BY_ASC = %22createDate ASC%22;%0A%0A%09public static final String ORDER_BY_DESC = %22createDate DESC%22;%0A%0A%09public static final String%5B%5D ORDER_BY_FIELDS = %7B%0A%09%09%22createDate%22%0A%09%7D;%0A%0A%09public ActionHistoryCreateDateComparator() %7B%0A%09%09this(%0A%09%09%09false);%0A%09%7D%0A%0A%09public ActionHistoryCreateDateComparator(boolean ascending) %7B%0A%09%09_ascending = ascending;%0A%09%7D%0A%0A%09@Override%0A%09public int compare(Object obj1, Object obj2) %7B%0A%0A%09%09ActionHistory actionHistory1 = (ActionHistory) obj1;%0A%09%09ActionHistory actionHistory2 = (ActionHistory) obj2;%0A%0A%09%09int value = DateUtil%0A%09%09%09.compareTo(actionHistory1%0A%09%09%09%09.getCreateDate(), actionHistory2%0A%09%09%09%09%09.getCreateDate());%0A%0A%09%09if (_ascending) %7B%0A%09%09%09return value;%0A%09%09%7D%0A%09%09else %7B%0A%09%09%09return -value;%0A%09%09%7D%0A%09%7D%0A%0A%09@Override%0A%09public String getOrderBy() %7B%0A%0A%09%09if (_ascending) %7B%0A%09%09%09return ORDER_BY_ASC;%0A%09%09%7D%0A%09%09else %7B%0A%09%09%09return ORDER_BY_DESC;%0A%09%09%7D%0A%09%7D%0A%0A%09@Override%0A%09public String%5B%5D getOrderByFields() %7B%0A%0A%09%09return ORDER_BY_FIELDS;%0A%09%7D%0A%0A%09@Override%0A%09public boolean isAscending() %7B%0A%0A%09%09return _ascending;%0A%09%7D%0A%0A%09private boolean _ascending;%0A%0A%7D%0A%0A

Add ActionHistory comparator createDate