Le 19/04/2010 17:37, Eric Chatellier a écrit :
Le 19/04/2010 17:15, jpepin@users.chorem.org a écrit :
[...]
+ //Check if the account is not empty, return -1 + List<Account> existingSubAccounts = getChildrenAccounts(account); + if (CollectionUtils.isNotEmpty(existingSubAccounts)){ + result =-1; + } + else { // remove account - // FIXME !IMPORTANT! check that subaccounts are also deleted - AccountDAO accountDAO = LimaCallaoDAOHelper.getAccountDAO(transaction); + AccountDAO accountDAO = + LimaCallaoDAOHelper.getAccountDAO(transaction); accountDAO.delete(account); // commit transaction.commitTransaction(); + } } catch (TopiaException ex) { doCatch(transaction, ex, log); @@ -694,7 +722,38 @@ finally { doFinally(transaction, log); } + return result
Il veut mieux retourner une exception dans ce cas plutôt que -1
Et attention à l'indentation. Merci, Arnaud. -- Société Code Lutin http://www.codelutin.com tel : 02 40 50 29 28 fax : 09 59 92 29 28