r3589 - in trunk: lima-business/src/main/java/org/chorem/lima/business/ejb lima-callao/src/main/java/org/chorem/lima/entity
Author: mallon Date: 2012-08-08 18:30:29 +0200 (Wed, 08 Aug 2012) New Revision: 3589 Url: http://chorem.org/repositories/revision/lima/3589 Log: fixes #749 Les transactions sont desormais triees selon leurs dates (Ordre decroissant) Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialTransactionDAOImpl.java Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2012-08-08 16:09:25 UTC (rev 3588) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2012-08-08 16:30:29 UTC (rev 3589) @@ -59,9 +59,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.Date; -import java.util.HashSet; import java.util.List; -import java.util.Set; import static org.nuiton.i18n.I18n._; @@ -617,13 +615,9 @@ List<FinancialTransaction> financialTransactions = financialTransactionDAO.searchFinancialTransaction( financialTransactionSearch, accounts); - Set set = new HashSet() ; - set.addAll(financialTransactions) ; - ArrayList<FinancialTransaction> distinctFinancialTransactions = new ArrayList(set) ; - // merge result with sub entries EntryDAO entryDAO = getDaoHelper().getEntryDAO(); - for (FinancialTransaction financialTransaction : distinctFinancialTransactions) { + for (FinancialTransaction financialTransaction : financialTransactions) { result.add(financialTransaction); List<Entry> entries = entryDAO.findAllByFinancialTransaction(financialTransaction); Modified: trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialTransactionDAOImpl.java =================================================================== --- trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialTransactionDAOImpl.java 2012-08-08 16:09:25 UTC (rev 3588) +++ trunk/lima-callao/src/main/java/org/chorem/lima/entity/FinancialTransactionDAOImpl.java 2012-08-08 16:30:29 UTC (rev 3589) @@ -9,15 +9,15 @@ * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 3 of the + * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public + * + * You should have received a copy of the GNU General Public * License along with this program. If not, see * <http://www.gnu.org/licenses/gpl-3.0.html>. * #L% @@ -42,10 +42,10 @@ /** * Ajout de requetes specifiques aux financial transaction sur le DAO. - * + * * @author chatellier * @version $Revision$ - * + * * Last update : $Date$ * By : $Author$ */ @@ -278,7 +278,7 @@ */ public List<FinancialTransaction> searchFinancialTransaction(FinancialTransactionSearch financialTransactionSearch, List<Account> accounts) throws TopiaException { - String query = "SELECT T FROM " + FinancialTransaction.class.getName() + " T"+ + String query = "SELECT distinct T FROM " + FinancialTransaction.class.getName() + " T"+ " JOIN T.entry AS E" + " WHERE 1=1 "; // to not manage first where in all condition @@ -393,6 +393,8 @@ } } + query += " order by T.transactionDate desc"; + if (log.isDebugEnabled()) { log.debug("Generated query : " + query); }
participants (1)
-
mallon@users.chorem.org