IDEMPIERE-1231 Add non-persistent attributes support to PO

This commit is contained in:
Elaine Tan 2013-08-01 17:34:50 +08:00
parent 92580221f7
commit bc81a931df
1 changed files with 20 additions and 2 deletions

View File

@ -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,6 +251,8 @@ public abstract class PO
private int m_idOld = 0;
/** Custom Columns */
private HashMap<String,String> m_custom = null;
/** Attributes */
private HashMap<String,Object> m_attributes = null;
/** Zero Integer */
protected static final Integer I_ZERO = new Integer(0);
@ -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<String, Object>();
m_attributes.put(columnName, value);
}
public Object getAttribute(String columnName) {
if (m_attributes != null)
return m_attributes.get(columnName);
return null;
}
public HashMap<String,Object> getAttributes() {
return m_attributes;
}
} // PO