From bc81a931df61e977ca482436615c1e33f612d3eb Mon Sep 17 00:00:00 2001 From: Elaine Tan Date: Thu, 1 Aug 2013 17:34:50 +0800 Subject: [PATCH] IDEMPIERE-1231 Add non-persistent attributes support to PO --- .../src/org/compiere/model/PO.java | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/PO.java b/org.adempiere.base/src/org/compiere/model/PO.java index b315c158f0..87f5a1d338 100644 --- a/org.adempiere.base/src/org/compiere/model/PO.java +++ b/org.adempiere.base/src/org/compiere/model/PO.java @@ -105,7 +105,7 @@ public abstract class PO /** * */ - private static final long serialVersionUID = 8742545079591136114L; + private static final long serialVersionUID = -341748204028700040L; public static final String LOCAL_TRX_PREFIX = "POSave"; @@ -251,7 +251,9 @@ public abstract class PO private int m_idOld = 0; /** Custom Columns */ private HashMap m_custom = null; - + /** Attributes */ + private HashMap m_attributes = null; + /** Zero Integer */ protected static final Integer I_ZERO = new Integer(0); /** Accounting Columns */ @@ -4515,4 +4517,20 @@ public abstract class PO ois.defaultReadObject(); log = CLogger.getCLogger(getClass()); } + + public void setAttribute(String columnName, Object value) { + if (m_attributes == null) + m_attributes = new HashMap(); + m_attributes.put(columnName, value); + } + + public Object getAttribute(String columnName) { + if (m_attributes != null) + return m_attributes.get(columnName); + return null; + } + + public HashMap getAttributes() { + return m_attributes; + } } // PO