Related to ISSUE-42816: Code Review Changes:
authorDavid Miguelez <david.miguelez@openbravo.com>
Fri, 17 Jan 2020 14:36:52 +0100
changeset 36958 69fe71ead208
parent 36957 95c3147aa768
child 36959 969f04ef4a91
Related to ISSUE 42816: Code Review Changes:
* Use id instead of object in query
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_BankStatementProcess.java
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_BankStatementProcess.java	Tue Jan 14 10:17:11 2020 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_BankStatementProcess.java	Fri Jan 17 14:36:52 2020 +0100
@@ -166,16 +166,16 @@
     //@formatter:off
     final String hql =
                   "as bsl " +
-                  " where bsl.bankStatement.account = :account" +
-                  "   and bsl.bankStatement <> :bankStatement" +
+                  " where bsl.bankStatement.account.id = :accountId" +
+                  "   and bsl.bankStatement.id <> :bankStatementId" +
                   "   and bsl.bankStatement.processed = 'Y'" +
                   " order by bsl.transactionDate desc";
     //@formatter:on
 
     FIN_BankStatementLine line = OBDal.getInstance()
         .createQuery(FIN_BankStatementLine.class, hql)
-        .setNamedParameter("account", bankstatement.getAccount())
-        .setNamedParameter("bankStatement", bankstatement)
+        .setNamedParameter("accountId", bankstatement.getAccount().getId())
+        .setNamedParameter("bankStatementId", bankstatement.getId())
         .setMaxResult(1)
         .uniqueResult();