From 35f0b830a05ea221a070e25347415e38548db6c4 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Thu, 25 Jun 2015 21:11:15 -0500 Subject: [PATCH] IDEMPIERE-2699 Performance: Constant visits to database for MTable not cached --- org.adempiere.base/src/org/compiere/model/MColumn.java | 8 +++++++- org.adempiere.base/src/org/compiere/model/MRefTable.java | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MColumn.java b/org.adempiere.base/src/org/compiere/model/MColumn.java index ba2a38bc85..8e9338a3b5 100644 --- a/org.adempiere.base/src/org/compiere/model/MColumn.java +++ b/org.adempiere.base/src/org/compiere/model/MColumn.java @@ -48,7 +48,7 @@ public class MColumn extends X_AD_Column /** * */ - private static final long serialVersionUID = -4372212315789445915L; + private static final long serialVersionUID = -7470893214933465732L; /** * Get MColumn from Cache @@ -830,4 +830,10 @@ public class MColumn extends X_AD_Column } } + @Override + public I_AD_Table getAD_Table() throws RuntimeException { + MTable table = MTable.get(getCtx(), getAD_Table_ID()); + return table; + } + } // MColumn diff --git a/org.adempiere.base/src/org/compiere/model/MRefTable.java b/org.adempiere.base/src/org/compiere/model/MRefTable.java index 589f03ed04..17402dd25e 100644 --- a/org.adempiere.base/src/org/compiere/model/MRefTable.java +++ b/org.adempiere.base/src/org/compiere/model/MRefTable.java @@ -25,7 +25,7 @@ public class MRefTable extends X_AD_Ref_Table /** * */ - private static final long serialVersionUID = 9123965213307214868L; + private static final long serialVersionUID = 380648726485603193L; /** * Standard Constructor @@ -57,4 +57,10 @@ public class MRefTable extends X_AD_Ref_Table super (ctx, rs, trxName); } // MRefTable + @Override + public I_AD_Table getAD_Table() throws RuntimeException { + MTable table = MTable.get(getCtx(), getAD_Table_ID()); + return table; + } + } // MRefTable