//uuid columnint uuidColumnId = DB.getSQLValue(get_TrxName(),"SELECT col.AD_Column_ID FROM AD_Column col INNER JOIN AD_Table tbl ON col.AD_Table_ID = tbl.AD_Table_ID WHERE tbl.TableName=? AND col.ColumnName=?", tableName+"_Trl", PO.getUUIDColumnName(tableName+"_Trl"));
This is in insertTranslations, insert_Accounting and insert_Tree.
Visiting the database every time is expensive, this would be better refactored to discover the existence of the UUID column using cache.
Testing https://idempiere.atlassian.net/browse/IDEMPIERE-4061#icft=IDEMPIERE-4061 I noticed in PO.java the following code repeated several times:
//uuid column int uuidColumnId = DB.getSQLValue(get_TrxName(), "SELECT col.AD_Column_ID FROM AD_Column col INNER JOIN AD_Table tbl ON col.AD_Table_ID = tbl.AD_Table_ID WHERE tbl.TableName=? AND col.ColumnName=?", tableName+"_Trl", PO.getUUIDColumnName(tableName+"_Trl"));
This is in insertTranslations, insert_Accounting and insert_Tree.
Visiting the database every time is expensive, this would be better refactored to discover the existence of the UUID column using cache.