From a95983730f85ff25700c6a5538449c3a47688a4c Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 14 Sep 2021 15:17:45 +0200 Subject: [PATCH] IDEMPIERE-4963 Performance: avoid loop in X_ class interface getters (#880) --- org.adempiere.base-feature/model.generator.launch | 6 +++++- .../src/org/adempiere/util/ModelClassGenerator.java | 6 +++--- .../src/org/compiere/model/I_AD_PInstance_Para.java | 2 +- .../src/org/compiere/model/X_AD_PInstance_Para.java | 11 ++++++----- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/org.adempiere.base-feature/model.generator.launch b/org.adempiere.base-feature/model.generator.launch index 46fc6318f1..53e3c3fa1d 100644 --- a/org.adempiere.base-feature/model.generator.launch +++ b/org.adempiere.base-feature/model.generator.launch @@ -30,7 +30,9 @@ + + @@ -61,6 +63,7 @@ + @@ -74,6 +77,7 @@ + @@ -91,7 +95,6 @@ - @@ -101,6 +104,7 @@ + diff --git a/org.adempiere.base/src/org/adempiere/util/ModelClassGenerator.java b/org.adempiere.base/src/org/adempiere/util/ModelClassGenerator.java index 52d5abcaaa..6b0803e5bb 100644 --- a/org.adempiere.base/src/org/adempiere/util/ModelClassGenerator.java +++ b/org.adempiere.base/src/org/adempiere/util/ModelClassGenerator.java @@ -411,9 +411,9 @@ public class ModelClassGenerator { sb.append(NL) .append("\tpublic ").append(referenceClassName).append(" get").append(fieldName).append("() throws RuntimeException").append(NL) - .append(" {").append(NL) - .append("\t\treturn (").append(referenceClassName).append(")MTable.get(getCtx(), ").append(referenceClassName).append(".Table_Name)").append(NL) - .append("\t\t\t.getPO(get").append(columnName).append("(), get_TrxName());") + .append("\t{").append(NL) + .append("\t\treturn (").append(referenceClassName).append(")MTable.get(getCtx(), ").append(referenceClassName).append(".Table_ID)").append(NL) + .append("\t\t\t.getPO(get").append(columnName).append("(), get_TrxName());").append(NL) /**/ .append("\t}").append(NL) ; diff --git a/org.adempiere.base/src/org/compiere/model/I_AD_PInstance_Para.java b/org.adempiere.base/src/org/compiere/model/I_AD_PInstance_Para.java index 85f5c1cbd6..8484d542d0 100644 --- a/org.adempiere.base/src/org/compiere/model/I_AD_PInstance_Para.java +++ b/org.adempiere.base/src/org/compiere/model/I_AD_PInstance_Para.java @@ -22,7 +22,7 @@ import org.compiere.util.KeyNamePair; /** Generated Interface for AD_PInstance_Para * @author iDempiere (generated) - * @version Release 8.2 + * @version Development 9.0 */ public interface I_AD_PInstance_Para { diff --git a/org.adempiere.base/src/org/compiere/model/X_AD_PInstance_Para.java b/org.adempiere.base/src/org/compiere/model/X_AD_PInstance_Para.java index 8d36e23182..91089f1636 100644 --- a/org.adempiere.base/src/org/compiere/model/X_AD_PInstance_Para.java +++ b/org.adempiere.base/src/org/compiere/model/X_AD_PInstance_Para.java @@ -26,14 +26,14 @@ import org.compiere.util.KeyNamePair; /** Generated Model for AD_PInstance_Para * @author iDempiere (generated) - * @version Release 8.2 - $Id$ */ + * @version Development 9.0 - $Id$ */ public class X_AD_PInstance_Para extends PO implements I_AD_PInstance_Para, I_Persistent { /** * */ - private static final long serialVersionUID = 20201220L; + private static final long serialVersionUID = 20210914L; /** Standard Constructor */ public X_AD_PInstance_Para (Properties ctx, int AD_PInstance_Para_ID, String trxName) @@ -75,9 +75,10 @@ public class X_AD_PInstance_Para extends PO implements I_AD_PInstance_Para, I_Pe } public org.compiere.model.I_AD_PInstance getAD_PInstance() throws RuntimeException - { - return (org.compiere.model.I_AD_PInstance)MTable.get(getCtx(), org.compiere.model.I_AD_PInstance.Table_Name) - .getPO(getAD_PInstance_ID(), get_TrxName()); } + { + return (org.compiere.model.I_AD_PInstance)MTable.get(getCtx(), org.compiere.model.I_AD_PInstance.Table_ID) + .getPO(getAD_PInstance_ID(), get_TrxName()); + } /** Set Process Instance. @param AD_PInstance_ID