|
Adempiere 3.5.2a | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.compiere.model.PO
public abstract class PO
Persistent Object. Superclass for actual implementations
| Field Summary | |
|---|---|
static int |
ACCESSLEVEL_ALL
Access Level SCO 111 7 System shared info |
static int |
ACCESSLEVEL_CLIENT
Access Level _C_ 010 2 Client info |
static int |
ACCESSLEVEL_CLIENTORG
Access Level _CO 011 3 Client shared info |
static int |
ACCESSLEVEL_ORG
Access Level __O 001 1 Organization info |
static int |
ACCESSLEVEL_SYSTEM
Access Level S__ 100 4 System info |
static int |
ACCESSLEVEL_SYSTEMCLIENT
Access Level SC_ 110 6 System/Client info |
protected static String |
ENTITYTYPE_Dictionary
Dictionary Maintained Entity Type |
protected static String |
ENTITYTYPE_UserMaintained
User Maintained Entity Type |
protected static Integer |
I_ZERO
Zero Integer |
protected CLogger |
log
Logger |
protected Properties |
p_ctx
Context |
protected POInfo |
p_info
Model Info |
protected static String |
XML_ATTRIBUTE_AD_Table_ID
Table ID Attribute |
protected static String |
XML_ATTRIBUTE_Record_ID
Record ID Attribute |
| Constructor Summary | |
|---|---|
PO(Properties ctx)
Create New Persisent Object |
|
PO(Properties ctx,
int ID,
String trxName)
Create & Load existing Persistent Object |
|
PO(Properties ctx,
int ID,
String trxName,
ResultSet rs)
Create & Load existing Persistent Object. |
|
PO(Properties ctx,
PO source,
int AD_Client_ID,
int AD_Org_ID)
Create New PO by Copying existing (key not copied). |
|
PO(Properties ctx,
ResultSet rs,
String trxName)
Create & Load existing Persistent Object. |
|
| Method Summary | |
|---|---|
protected boolean |
afterDelete(boolean success)
Executed after Delete operation. |
protected boolean |
afterSave(boolean newRecord,
boolean success)
Called after Save for Post-Save Operation |
protected boolean |
beforeDelete()
Executed before Delete operation. |
protected boolean |
beforeSave(boolean newRecord)
Called before Save for Pre-Save Operation |
int |
compare(Object o1,
Object o2)
Compare based on DocumentNo, Value, Name, Description |
static void |
copyValues(PO from,
PO to)
Copy old values of From to new values of To. |
protected static void |
copyValues(PO from,
PO to,
int AD_Client_ID,
int AD_Org_ID)
Copy old values of From to new values of To. |
MAttachment |
createAttachment()
Create/return Attachment for PO. |
protected boolean |
delete_Accounting(String acctTable)
Delete Accounting records. |
protected boolean |
delete_Tree(String treeType)
Delete ID Tree Nodes |
boolean |
delete(boolean force)
Delete Current Record |
boolean |
delete(boolean force,
String trxName)
Delete Current Record |
void |
deleteEx(boolean force)
Delete Current Record |
void |
deleteEx(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 |
protected abstract int |
get_AccessLevel()
Get Table Access Level |
protected int |
get_ColumnCount()
Get Column Count |
protected String |
get_ColumnDescription(int index)
Get Column Description |
protected int |
get_ColumnDisplayType(int index)
Get Column DisplayType |
int |
get_ColumnIndex(String columnName)
Get Column Index |
protected String |
get_ColumnLabel(int index)
Get Column Label |
protected Lookup |
get_ColumnLookup(int index)
Get Lookup |
protected String |
get_ColumnName(int index)
Get Column Name |
protected String |
get_DisplayValue(String columnName,
boolean currentValue)
Get Display Value of value |
protected HashMap<String,String> |
get_HashMap()
Create Hashmap with data as Strings |
int |
get_ID()
Return Single Key Record ID |
int |
get_IDOld()
Return Deleted Single Key Record ID |
String[] |
get_KeyColumns()
Get Key Columns. |
CLogger |
get_Logger()
Get Logger |
int |
get_Table_ID()
Get Table ID. |
String |
get_TableName()
Get TableName. |
protected String |
get_Translation(String columnName,
String AD_Language)
Get Translation of column |
String |
get_TrxName()
Get Trx |
Object |
get_Value(int index)
Get Value |
Object |
get_Value(String columnName)
Get Value |
protected int |
get_ValueAsInt(int index)
Get Value as int |
String |
get_ValueAsString(String variableName)
Get Column Value |
Object |
get_ValueDifference(int index)
Return new - old |
Object |
get_ValueDifference(String columnName)
Return new - old |
protected Object |
get_ValueE(String columnName)
Get Encrypted Value |
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 |
protected int |
get_ValueOldAsInt(String columnName)
Get Old Value as int |
String |
get_WhereClause(boolean withValues)
Create Single/Multi Key Where Clause |
Document |
get_xmlDocument(boolean noComment)
Get XML Document representation |
StringBuffer |
get_xmlString(StringBuffer xml)
Get Object xml representation as string |
int |
getAD_Client_ID()
Get AD_Client |
int |
getAD_Org_ID()
Get AD_Org |
static int[] |
getAllIDs(String TableName,
String WhereClause,
String trxName)
Get All IDs of Table. |
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 |
Doc |
getDoc()
Set the accounting document associated to the PO - for use in POST ModelValidator |
protected static String |
getFindParameter(String query)
Get Find parameter. |
byte[] |
getPdfAttachment()
Get PDF Attachment Data |
Timestamp |
getUpdated()
Get Updated |
int |
getUpdatedBy()
Get UpdatedBy |
protected abstract POInfo |
initPO(Properties ctx)
Initialize and return PO_Info |
protected boolean |
insert_Accounting(String acctTable,
String acctBaseTable,
String whereClause)
Insert Accounting Records |
protected boolean |
insert_Tree(String treeType)
Insert id data into Tree |
protected boolean |
insert_Tree(String treeType,
int C_Element_ID)
Insert id data into Tree |
boolean |
is_Changed()
Is there a Change to be saved? |
boolean |
is_new()
Is new record |
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 |
protected boolean |
isColumnMandatory(int index)
Is Column Mandatory |
protected boolean |
isColumnUpdateable(int index)
Is Column Updateable |
protected boolean |
isMandatoryOK()
Are all mandatory Fields filled (i.e. can we save)?. |
boolean |
isPdfAttachment()
Do we have a PDF Attachment |
boolean |
isReplication()
|
protected boolean |
load(HashMap<String,String> hmIn)
Load from HashMap |
protected void |
load(int ID,
String trxName)
Load record with ID |
protected boolean |
load(ResultSet rs)
Load from the current position of a ResultSet |
boolean |
load(String trxName)
(re)Load record with m_ID[*] |
protected void |
loadComplete(boolean success)
Load is complete |
protected void |
loadDefaults()
Load Defaults |
protected Object |
loadSpecial(ResultSet rs,
int index)
Load Special data (images, ..). |
boolean |
lock()
Lock it. |
boolean |
save()
Update Value or create new record. |
boolean |
save(String trxName)
Update Value or create new record. |
void |
saveEx()
Update Value or create new record. |
void |
saveEx(String trxName)
Update Value or create new record. |
protected int |
saveNew_getID()
Get ID for new record during save. |
protected String |
saveNewSpecial(Object value,
int index)
Save Special Data. |
boolean |
saveReplica(boolean isFromReplication)
|
protected boolean |
saveUpdate()
Update Record directly |
protected void |
set_ColumnUpdateable(int index,
boolean updateable)
Set Column Updateable |
void |
set_CustomColumn(String columnName,
Object value)
Set Custom Column |
static void |
set_TrxName(PO[] lines,
String trxName)
PO.setTrxName - set given trxName to an array of POs As suggested by teo in [ 1854603 ] |
void |
set_TrxName(String trxName)
Set Trx |
protected boolean |
set_Value(int index,
Object value)
Set Value if updateable and correct class. |
protected boolean |
set_Value(String ColumnName,
Object value)
Set Value |
protected boolean |
set_ValueE(String ColumnName,
Object value)
Set Encrypted Value |
protected boolean |
set_ValueNoCheck(String ColumnName,
Object value)
Set Value w/o check (update, r/o, ..). |
protected boolean |
set_ValueNoCheckE(String ColumnName,
Object value)
Set Encrypted Value w/o check (update, r/o, ..). |
void |
set_ValueOfColumn(int AD_Column_ID,
Object value)
Set Value of Column |
void |
set_ValueOfColumn(String columnName,
Object value)
Set value of Column |
protected void |
setAD_Client_ID(int AD_Client_ID)
Set AD_Client |
void |
setAD_Org_ID(int AD_Org_ID)
Set AD_Org |
protected void |
setClientOrg(int AD_Client_ID,
int AD_Org_ID)
Overwrite Client Org if different |
protected void |
setClientOrg(PO po)
Overwrite Client Org if different |
void |
setDoc(Doc doc)
Set the accounting document associated to the PO - for use in POST ModelValidator |
static void |
setDocWorkflowMgr(DocWorkflowMgr docWFMgr)
Set Document Value Workflow Manager |
void |
setIsActive(boolean active)
Set Active |
void |
setReplication(boolean isFromReplication)
|
protected void |
setStandardDefaults()
Set Default values. |
protected void |
setUpdateable(boolean updateable)
Set all columns updateable |
protected void |
setUpdatedBy(int AD_User_ID)
Set UpdatedBy |
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 |
|---|
protected static final String ENTITYTYPE_UserMaintained
protected static final String ENTITYTYPE_Dictionary
protected transient CLogger log
protected Properties p_ctx
protected volatile POInfo p_info
protected static final Integer I_ZERO
public static final int ACCESSLEVEL_SYSTEM
public static final int ACCESSLEVEL_CLIENT
public static final int ACCESSLEVEL_ORG
public static final int ACCESSLEVEL_ALL
public static final int ACCESSLEVEL_SYSTEMCLIENT
public static final int ACCESSLEVEL_CLIENTORG
protected static final String XML_ATTRIBUTE_AD_Table_ID
protected static final String XML_ATTRIBUTE_Record_ID
| Constructor Detail |
|---|
public PO(Properties ctx)
ctx - context
public PO(Properties ctx,
int ID,
String trxName)
ID - The unique ID of the objectctx - contexttrxName - transaction name
public PO(Properties ctx,
ResultSet rs,
String trxName)
ctx - contextrs - optional - load from current result set position (no navigation, not closed)
if null, a new record is created.trxName - transaction name
public PO(Properties ctx,
int ID,
String trxName,
ResultSet rs)
You load
- an existing single key record with new PO (ctx, Record_ID)
or new PO (ctx, Record_ID, trxName)
or new PO (ctx, rs, get_TrxName())
- a new single key record with new PO (ctx, 0)
- an existing multi key record with new PO (ctx, rs, get_TrxName())
- a new multi key record with new PO (ctx, null)
The ID for new single key records is created automatically,
you need to set the IDs for multi-key records explicitly.
ctx - contextID - the ID if 0, the record defaults are applied - ignored if re existstrxName - transaction namers - optional - load from current result set position (no navigation, not closed)
public PO(Properties ctx,
PO source,
int AD_Client_ID,
int AD_Org_ID)
ctx - contextsource - souce objectAD_Client_ID - clientAD_Org_ID - org| Method Detail |
|---|
public static void setDocWorkflowMgr(DocWorkflowMgr docWFMgr)
docWFMgr - mgrprotected abstract POInfo initPO(Properties ctx)
ctx - context
protected abstract int get_AccessLevel()
public String toString()
toString in class Objectpublic boolean equals(Object cmp)
equals in interface Comparatorequals in class Objectcmp - comperator
public int compare(Object o1,
Object o2)
compare in interface Comparatoro1 - Object 1o2 - Object 2
public String get_TableName()
public String[] get_KeyColumns()
public int get_Table_ID()
public int get_ID()
public int get_IDOld()
public Properties getCtx()
public CLogger get_Logger()
public final Object get_Value(int index)
index - index
protected int get_ValueAsInt(int index)
index - index
public final Object get_Value(String columnName)
columnName - column name
protected final Object get_ValueE(String columnName)
columnName - column name
public String get_ValueAsString(String variableName)
get_ValueAsString in interface EvaluateevariableName - name
public final Object get_ValueOfColumn(int AD_Column_ID)
AD_Column_ID - column
public final Object get_ValueOld(int index)
index - index
public final Object get_ValueOld(String columnName)
columnName - column name
protected int get_ValueOldAsInt(String columnName)
columnName - column name
public final boolean is_ValueChanged(int index)
index - index
public final boolean is_ValueChanged(String columnName)
columnName - column name
public final Object get_ValueDifference(int index)
index - index
public final Object get_ValueDifference(String columnName)
columnName - column name
protected final boolean set_Value(String ColumnName,
Object value)
ColumnName - column namevalue - value
protected final boolean set_ValueE(String ColumnName,
Object value)
ColumnName - column namevalue - value
protected final boolean set_Value(int index,
Object value)
index - indexvalue - value
protected final boolean set_ValueNoCheck(String ColumnName,
Object value)
ColumnName - column namevalue - value
protected final boolean set_ValueNoCheckE(String ColumnName,
Object value)
ColumnName - column namevalue - value
public final void set_ValueOfColumn(String columnName,
Object value)
columnName - value -
public final void set_ValueOfColumn(int AD_Column_ID,
Object value)
AD_Column_ID - columnvalue - value
public final void set_CustomColumn(String columnName,
Object value)
columnName - columnvalue - valueprotected int get_ColumnCount()
protected String get_ColumnName(int index)
index - index
protected String get_ColumnLabel(int index)
index - index
protected String get_ColumnDescription(int index)
index - index
protected boolean isColumnMandatory(int index)
index - index
protected boolean isColumnUpdateable(int index)
index - index
protected void set_ColumnUpdateable(int index,
boolean updateable)
index - indexupdateable - column updateableprotected void setUpdateable(boolean updateable)
updateable - updateableprotected int get_ColumnDisplayType(int index)
index - index
protected Lookup get_ColumnLookup(int index)
index - index
public final int get_ColumnIndex(String columnName)
columnName - column name
protected String get_DisplayValue(String columnName,
boolean currentValue)
columnName - columnNamecurrentValue - current value
protected static void copyValues(PO from,
PO to,
int AD_Client_ID,
int AD_Org_ID)
from - old, existing & unchanged POto - new, not saved POAD_Client_ID - clientAD_Org_ID - org
public static void copyValues(PO from,
PO to)
from - old, existing & unchanged POto - new, not saved PO
protected void load(int ID,
String trxName)
ID - IDtrxName - transaction namepublic boolean load(String trxName)
trxName - transaction
protected boolean load(ResultSet rs)
rs - result set
protected boolean load(HashMap<String,String> hmIn)
hmIn - hash map
protected HashMap<String,String> get_HashMap()
protected Object loadSpecial(ResultSet rs,
int index)
throws SQLException
rs - result setindex - zero based index
SQLExceptionprotected void loadComplete(boolean success)
success - success
To be extended by sub-classesprotected void loadDefaults()
protected void setStandardDefaults()
protected boolean isMandatoryOK()
protected final void setAD_Client_ID(int AD_Client_ID)
AD_Client_ID - clientpublic final int getAD_Client_ID()
public final void setAD_Org_ID(int AD_Org_ID)
AD_Org_ID - orgpublic int getAD_Org_ID()
protected void setClientOrg(int AD_Client_ID,
int AD_Org_ID)
AD_Client_ID - clientAD_Org_ID - orgprotected void setClientOrg(PO po)
po - persistent objectpublic final void setIsActive(boolean active)
active - activepublic final boolean isActive()
public final Timestamp getCreated()
public final Timestamp getUpdated()
public final int getCreatedBy()
public final int getUpdatedBy()
protected final void setUpdatedBy(int AD_User_ID)
AD_User_ID - user
protected String get_Translation(String columnName,
String AD_Language)
columnName - AD_Language -
public boolean is_new()
public boolean save()
public void saveEx()
throws AdempiereException
AdempiereExceptionsave()public boolean save(String trxName)
trxName - transaction
public boolean saveReplica(boolean isFromReplication)
public void saveEx(String trxName)
throws AdempiereException
trxName - transaction
AdempiereExceptionsaveEx(String)public boolean is_Changed()
protected boolean beforeSave(boolean newRecord)
newRecord - new record
protected boolean afterSave(boolean newRecord,
boolean success)
newRecord - new recordsuccess - true if save operation was success
protected boolean saveUpdate()
protected int saveNew_getID()
public String get_WhereClause(boolean withValues)
withValues - if true uses actual values otherwise ?
protected String saveNewSpecial(Object value,
int index)
value - valueindex - index
public boolean delete(boolean force)
force - delete also processed records
public void deleteEx(boolean force)
throws AdempiereException
force - delete also processed records
AdempiereExceptiondelete(boolean)
public boolean delete(boolean force,
String trxName)
force - delete also processed recordstrxName - transaction
public void deleteEx(boolean force,
String trxName)
throws AdempiereException
force - delete also processed recordstrxName - transaction
AdempiereException#deleteEx(boolean)}protected boolean beforeDelete()
protected boolean afterDelete(boolean success)
success - true if record deleted
protected boolean insert_Accounting(String acctTable,
String acctBaseTable,
String whereClause)
acctTable - accounting sub tableacctBaseTable - acct table to get data fromwhereClause - optional where clause with alisa "p" for acctBaseTable
protected boolean delete_Accounting(String acctTable)
acctTable - accounting sub table
protected boolean insert_Tree(String treeType)
treeType - MTree TREETYPE_*
protected boolean insert_Tree(String treeType,
int C_Element_ID)
treeType - MTree TREETYPE_*C_Element_ID - element for accounting element values
protected boolean delete_Tree(String treeType)
treeType - MTree TREETYPE_*
public boolean lock()
public boolean unlock(String trxName)
trxName - transaction
public void set_TrxName(String trxName)
trxName - transactionpublic String get_TrxName()
public MAttachment getAttachment()
public MAttachment getAttachment(boolean requery)
requery - requery
public MAttachment createAttachment()
public boolean isAttachment(String extension)
extension - extension e.g. .pdf
public byte[] getAttachmentData(String extension)
extension - extension e.g. .pdf
public boolean isPdfAttachment()
public byte[] getPdfAttachment()
public void dump()
public void dump(int index)
index - index
public static int[] getAllIDs(String TableName,
String WhereClause,
String trxName)
int[] IDs = PO.getAllIDs ("AD_PrintFont", null);
for (int i = 0; i < IDs.length; i++)
{
pf = new MPrintFont(Env.getCtx(), IDs[i]);
System.out.println(IDs[i] + " = " + pf.getFont());
}
TableName - table name (key column with _ID)WhereClause - optional where clausetrxName - transaction
protected static String getFindParameter(String query)
query - in string
public StringBuffer get_xmlString(StringBuffer xml)
xml - optional string buffer
public Document get_xmlDocument(boolean noComment)
noComment - do not add comment
public void setDoc(Doc doc)
doc - Documentpublic void setReplication(boolean isFromReplication)
public boolean isReplication()
public Doc getDoc()
public static void set_TrxName(PO[] lines,
String trxName)
|
Adempiere 3.5.2a | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||