Fixes issue 41434: Apply HQL style guide to DocFINFinAccTransaction
authorArmaignac <collazoandy4@gmail.com>
Wed, 24 Jul 2019 00:33:39 -0400
changeset 36441 cd20f6aaf921
parent 36440 b2063b37126e
child 36442 f70b1418b598
Fixes issue 41434: Apply HQL style guide to DocFINFinAccTransaction

Applied the new HQL style in DocFINFinAccTransaction
src/org/openbravo/erpCommon/ad_forms/DocFINFinAccTransaction.java
--- a/src/org/openbravo/erpCommon/ad_forms/DocFINFinAccTransaction.java	Mon Aug 19 12:57:44 2019 +0200
+++ b/src/org/openbravo/erpCommon/ad_forms/DocFINFinAccTransaction.java	Wed Jul 24 00:33:39 2019 -0400
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2010-2018 Openbravo SLU
+ * All portions are Copyright (C) 2010-2019 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -589,18 +589,21 @@
       VariablesSecureApp vars) throws ServletException {
     // Select specific definition
     String strClassname = "";
-    final StringBuilder whereClause = new StringBuilder();
     Fact fact = new Fact(this, as, Fact.POST_Actual);
     OBContext.setAdminMode();
     try {
-      whereClause.append(" as astdt ");
-      whereClause.append(
-          " where astdt.acctschemaTable.accountingSchema.id = '" + as.m_C_AcctSchema_ID + "'");
-      whereClause.append(" and astdt.acctschemaTable.table.id = '" + AD_Table_ID + "'");
-      whereClause.append(" and astdt.documentCategory = '" + DocumentType + "'");
+      //@formatter:off
+      final String whereClause = " as astdt "
+          + " where astdt.acctschemaTable.accountingSchema.id = "
+          + "'" + as.m_C_AcctSchema_ID + "'"
+          + "   and astdt.acctschemaTable.table.id = "
+          + "'" + AD_Table_ID + "'"
+          + "   and astdt.documentCategory = "
+          + "'" + DocumentType + "'";
 
+      //@formatter:on
       final OBQuery<AcctSchemaTableDocType> obqParameters = OBDal.getInstance()
-          .createQuery(AcctSchemaTableDocType.class, whereClause.toString());
+          .createQuery(AcctSchemaTableDocType.class, whereClause);
       final List<AcctSchemaTableDocType> acctSchemaTableDocTypes = obqParameters.list();
 
       if (acctSchemaTableDocTypes != null && acctSchemaTableDocTypes.size() > 0
@@ -609,14 +612,16 @@
       }
 
       if (strClassname.equals("")) {
-        final StringBuilder whereClause2 = new StringBuilder();
-
-        whereClause2.append(" as ast ");
-        whereClause2.append(" where ast.accountingSchema.id = '" + as.m_C_AcctSchema_ID + "'");
-        whereClause2.append(" and ast.table.id = '" + AD_Table_ID + "'");
+        //@formatter:off
+        final String whereClause2 = " as ast "
+            + " where ast.accountingSchema.id = "
+            + "'" + as.m_C_AcctSchema_ID + "'"
+            + "   and ast.table.id = "
+            + "'" + AD_Table_ID + "'";
+        //@formatter:on
 
         final OBQuery<AcctSchemaTable> obqParameters2 = OBDal.getInstance()
-            .createQuery(AcctSchemaTable.class, whereClause2.toString());
+            .createQuery(AcctSchemaTable.class, whereClause2);
         final List<AcctSchemaTable> acctSchemaTables = obqParameters2.list();
         if (acctSchemaTables != null && acctSchemaTables.size() > 0
             && acctSchemaTables.get(0).getCreatefactTemplate() != null) {