Adempiere 3.5.2a

org.eevolution.model.wrapper
Class AbstractPOWrapper

java.lang.Object
  extended by org.eevolution.model.wrapper.AbstractPOWrapper
Direct Known Subclasses:
BOMLineWrapper, BOMWrapper

public abstract class AbstractPOWrapper
extends Object

Version:
1.0, October 14th 2005
Author:
Gunther Hoppe, tranSIT GmbH Ilmenau/Germany

Field Summary
protected  PO po
           
 
Constructor Summary
AbstractPOWrapper(Properties ctx, int id, String trxName, String type)
           
 
Method Summary
 int compare(Object o1, Object o2)
          Compare based on DocumentNo, Value, Name, Description
 MAttachment createAttachment()
          Create/return Attachment for PO.
 boolean delete(boolean force)
          Delete Current Record
 boolean delete(boolean force, String trxName)
          Delete Current Record
 void dump()
          Dump Record
 void dump(int index)
          Dump column
 boolean equals(Object cmp)
          Equals based on ID
 int get_ColumnIndex(String columnName)
          Get Column Index
 String get_TableName()
          Get TableName.
 String get_TrxName()
          Get Trx
 Object get_Value(int index)
          Get Value
 Object get_Value(String columnName)
          Get Value
 String get_ValueAsString(String variableName)
          Get Column Value
 Object get_ValueDifference(int index)
          Return new - old
 Object get_ValueDifference(String columnName)
          Return new - old
 Object get_ValueOfColumn(int AD_Column_ID)
          Get Value of Column
 Object get_ValueOld(int index)
          Get Old Value
 Object get_ValueOld(String columnName)
          Get Old Value
 String get_WhereClause(boolean withValues)
          Create Single/Multi Key Where Clause
 PO get()
           
 int getAD_Client_ID()
          Get AD_Client
 int getAD_Org_ID()
          Get AD_Org
 MAttachment getAttachment()
          Get Attachments.
 MAttachment getAttachment(boolean requery)
          Get Attachments
 byte[] getAttachmentData(String extension)
          Get Attachment Data of type
 Timestamp getCreated()
          Get Created
 int getCreatedBy()
          Get CreatedBy
 Properties getCtx()
          Get Context
 int getID()
          Return Single Key Record ID
 int getIDOld()
          Return Deleted Single Key Record ID
 byte[] getPdfAttachment()
          Get PDF Attachment Data
 Timestamp getUpdated()
          Get Updated
 int getUpdatedBy()
          Get UpdatedBy
 boolean is_Changed()
          Is there a Change to be saved?
 boolean is_ValueChanged(int index)
          Is Value Changed
 boolean is_ValueChanged(String columnName)
          Is Value Changed
 boolean isActive()
          Is Active
 boolean isAttachment(String extension)
          Do we have a Attachment of type
 boolean isPdfAttachment()
          Do we have a PDF Attachment
 boolean load(String trxName)
          (re)Load record with m_ID[*]
 boolean lock()
          Lock it.
protected abstract  PO receivePO(Properties ctx, int id, String trxName, String type)
           
 boolean save()
          Update Value or create new record.
 boolean save(String trxName)
          Update Value or create new record.
 void set_CustomColumn(String columnName, Object value)
          Set Custom Column
 void set_TrxName(String trxName)
          Set Trx
 void set_ValueOfColumn(int AD_Column_ID, Object value)
          Set Value of Column
 void setIsActive(boolean active)
          Set Active
 String toString()
          String representation
 boolean unlock(String trxName)
          UnLock it
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

po

protected PO po
Constructor Detail

AbstractPOWrapper

public AbstractPOWrapper(Properties ctx,
                         int id,
                         String trxName,
                         String type)
Method Detail

receivePO

protected abstract PO receivePO(Properties ctx,
                                int id,
                                String trxName,
                                String type)

get

public PO get()

toString

public String toString()
String representation

Overrides:
toString in class Object
Returns:
String representation

equals

public boolean equals(Object cmp)
Equals based on ID

Overrides:
equals in class Object
Parameters:
cmp - comperator
Returns:
true if ID the same

compare

public int compare(Object o1,
                   Object o2)
Compare based on DocumentNo, Value, Name, Description

Parameters:
o1 - Object 1
o2 - Object 2
Returns:
-1 if o1 < o2

get_TableName

public String get_TableName()
Get TableName.

Returns:
table name

getID

public int getID()
Return Single Key Record ID

Returns:
ID or 0

getIDOld

public int getIDOld()
Return Deleted Single Key Record ID

Returns:
ID or 0

getCtx

public Properties getCtx()
Get Context

Returns:
context

get_Value

public Object get_Value(int index)
Get Value

Parameters:
index - index
Returns:
value

get_Value

public Object get_Value(String columnName)
Get Value

Parameters:
columnName - column name
Returns:
value or null

get_ValueAsString

public String get_ValueAsString(String variableName)
Get Column Value

Parameters:
variableName - name
Returns:
value or ""

get_ValueOfColumn

public Object get_ValueOfColumn(int AD_Column_ID)
Get Value of Column

Parameters:
AD_Column_ID - column
Returns:
value or null

get_ValueOld

public Object get_ValueOld(int index)
Get Old Value

Parameters:
index - index
Returns:
value

get_ValueOld

public Object get_ValueOld(String columnName)
Get Old Value

Parameters:
columnName - column name
Returns:
value or null

is_ValueChanged

public boolean is_ValueChanged(int index)
Is Value Changed

Parameters:
index - index
Returns:
true if changed

is_ValueChanged

public boolean is_ValueChanged(String columnName)
Is Value Changed

Parameters:
columnName - column name
Returns:
true if changed

get_ValueDifference

public Object get_ValueDifference(int index)
Return new - old. - New Value if Old Valus is null - New Value - Old Value if Number - otherwise null

Parameters:
index - index
Returns:
new - old or null if not appropiate or not changed

get_ValueDifference

public Object get_ValueDifference(String columnName)
Return new - old. - New Value if Old Valus is null - New Value - Old Value if Number - otherwise null

Parameters:
columnName - column name
Returns:
new - old or null if not appropiate or not changed

set_ValueOfColumn

public void set_ValueOfColumn(int AD_Column_ID,
                              Object value)
Set Value of Column

Parameters:
AD_Column_ID - column
value - value

set_CustomColumn

public void set_CustomColumn(String columnName,
                             Object value)
Set Custom Column

Parameters:
columnName - column
value - value

get_ColumnIndex

public int get_ColumnIndex(String columnName)
Get Column Index

Parameters:
columnName - column name
Returns:
index of column with ColumnName or -1 if not found

load

public boolean load(String trxName)
(re)Load record with m_ID[*]


getAD_Client_ID

public int getAD_Client_ID()
Get AD_Client

Returns:
AD_Client_ID

getAD_Org_ID

public int getAD_Org_ID()
Get AD_Org

Returns:
AD_Org_ID

setIsActive

public void setIsActive(boolean active)
Set Active

Parameters:
active - active

isActive

public boolean isActive()
Is Active

Returns:
is active

getCreated

public Timestamp getCreated()
Get Created

Returns:
created

getUpdated

public Timestamp getUpdated()
Get Updated

Returns:
updated

getCreatedBy

public int getCreatedBy()
Get CreatedBy

Returns:
AD_User_ID

getUpdatedBy

public int getUpdatedBy()
Get UpdatedBy

Returns:
AD_User_ID

save

public boolean save()
Update Value or create new record. To reload call load() - not updated

Returns:
true if saved

save

public boolean save(String trxName)
Update Value or create new record. To reload call load() - not updated

Parameters:
trxName - transaction
Returns:
true if saved

is_Changed

public boolean is_Changed()
Is there a Change to be saved?

Returns:
true if record changed

get_WhereClause

public String get_WhereClause(boolean withValues)
Create Single/Multi Key Where Clause

Parameters:
withValues - if true uses actual values otherwise ?
Returns:
where clause

delete

public boolean delete(boolean force)
Delete Current Record

Parameters:
force - delete also processed records
Returns:
true if deleted

delete

public boolean delete(boolean force,
                      String trxName)
Delete Current Record

Parameters:
force - delete also processed records
trxName - transaction

lock

public boolean lock()
Lock it.

Returns:
true if locked

unlock

public boolean unlock(String trxName)
UnLock it

Returns:
true if unlocked (false only if unlock fails)

set_TrxName

public void set_TrxName(String trxName)
Set Trx

Parameters:
trxName - transaction

get_TrxName

public String get_TrxName()
Get Trx

Returns:
transaction

getAttachment

public MAttachment getAttachment()
Get Attachments. An attachment may have multiple entries

Returns:
Attachment or null

getAttachment

public MAttachment getAttachment(boolean requery)
Get Attachments

Parameters:
requery - requery
Returns:
Attachment or null

createAttachment

public MAttachment createAttachment()
Create/return Attachment for PO. If not exist, create new

Returns:
attachment

isAttachment

public boolean isAttachment(String extension)
Do we have a Attachment of type

Parameters:
extension - extension e.g. .pdf
Returns:
true if there is a attachment of type

getAttachmentData

public byte[] getAttachmentData(String extension)
Get Attachment Data of type

Parameters:
extension - extension e.g. .pdf
Returns:
data or null

isPdfAttachment

public boolean isPdfAttachment()
Do we have a PDF Attachment

Returns:
true if there is a PDF attachment

getPdfAttachment

public byte[] getPdfAttachment()
Get PDF Attachment Data

Returns:
data or null

dump

public void dump()
Dump Record


dump

public void dump(int index)
Dump column

Parameters:
index - index

Adempiere 3.5.2a

Adempiere® is a registered trademark of ADempiere Business Inc. ©2004-2008 HumanFlash.com All rights reserved.