From 8630cd1d11f6fee8db5d5ed47cd74ed4edd1e028 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Mon, 16 Jul 2007 03:42:35 +0000 Subject: [PATCH] * minor - add retrieval by name convenient method. --- base/src/org/compiere/model/MUOM.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/base/src/org/compiere/model/MUOM.java b/base/src/org/compiere/model/MUOM.java index fe945602e5..264b415088 100644 --- a/base/src/org/compiere/model/MUOM.java +++ b/base/src/org/compiere/model/MUOM.java @@ -127,6 +127,21 @@ public class MUOM extends X_C_UOM s_cache.put(new Integer(C_UOM_ID), uom); return uom; } // getUOMfromCache + + /** + * Get UOM by name + * @param ctx + * @param name + * @param trxName + * @return MUOM if found, null if not found + */ + public static MUOM get(Properties ctx, String name, String trxName) + { + MTable table = MTable.get(Env.getCtx(), Table_ID); + MUOM uom = (MUOM)table.getPO("Name = ?", new Object[]{name}, trxName); + + return uom; + } /** * Get Precision