|
Compiere 3.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.compiere.framework.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 ChangeVO |
p_changeVO
Change VO |
protected POInfo |
p_info
Model Info |
static String |
XML_ATTRIBUTE_AD_Table_ID
Table ID Attribute |
static String |
XML_ATTRIBUTE_Record_ID
Record ID Attribute |
| Constructor Summary | |
|---|---|
PO(Ctx ctx)
Create New Persisent Object |
|
PO(Ctx ctx,
int ID,
String trxName)
Create & Load existing Persistent Object |
|
PO(Ctx ctx,
PO source,
int AD_Client_ID,
int AD_Org_ID)
Create New PO by Copying existing (key not copied). |
|
PO(Ctx ctx,
ResultSet rs,
String trxName)
Create & Load existing Persistent Object. |
|
PO(Ctx ctx,
VO vo)
VO Constructor |
|
| Method Summary | |
|---|---|
boolean |
addAttachment(File file)
Add Attachment to Record |
boolean |
addAttachment(URI uri)
Add Attachment to Record |
protected void |
addError(String message)
Added the message text to p_changeVO if p_changeVO is not null. |
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(PO o1,
PO o2)
Compare based on DocumentNo, Value, Name, Description |
static BigDecimal |
convertToBigDecimal(String stringValue)
Convert String To BigDecimal. |
static boolean |
convertToBoolean(String stringValue)
Convert String To boolean. |
static int |
convertToInt(String stringValue)
Convert String To int. |
static Timestamp |
convertToTimestamp(String stringValue)
Convert String To Timestamp. |
static PO |
copy(Ctx ctx,
PO po)
Get a copy/clone of PO and set ctx |
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. |
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 |
protected abstract int |
get_AccessLevel()
Get Table Access Level |
ChangeVO |
get_ChangeVO()
Get Change VO |
int |
get_ColumnCount()
Get Column Count |
protected String |
get_ColumnDescription(int index)
Get Column Description |
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 |
String |
get_ColumnName(int index)
Get Column Name |
protected String |
get_DisplayValue(String columnName,
boolean currentValue)
Get Display Value of value |
String |
get_EntityType()
Get Entity Type of record |
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 |
POInfo |
get_Info()
Get PO Info |
String[] |
get_KeyColumns()
Get Key Columns. |
CLogger |
get_Logger()
Get Logger |
int |
get_Table_ID()
Get AD Table ID. |
static int |
get_Table_ID(String tableName)
Get ID of table |
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 |
int |
get_ValueAsInt(String columnName)
Get Value as Integer |
String |
get_ValueAsString(String columnName)
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 |
protected int |
get_ValueOldAsInt(String columnName)
Get Old Value as int |
String[] |
get_ValuesAsString(String[] columnNames)
Get Column Values as String |
String |
get_WhereClause(boolean withValues)
Create Single/Multi Key Where Clause |
Document |
get_xmlDocument(boolean noComment,
boolean dataOnly)
Get XML Document representation |
StringBuffer |
get_xmlString(StringBuffer xml)
Get Object xml (data only) representation as string |
StringBuffer |
get_xmlString(StringBuffer xml,
boolean dataOnly)
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 |
Ctx |
getCtx()
Get Context |
protected static String |
getFindParameter(String query)
Get Find parameter. |
byte[] |
getPdfAttachment()
Get PDF Attachment Data |
Timestamp |
getUpdated()
Get Updated |
int |
getUpdatedBy()
Get UpdatedBy |
VO |
getVO()
Get Object as VO |
int |
hashCode()
Used for HashTable |
protected abstract POInfo |
initPO(Ctx ctx)
Initialize and return PO_Info |
protected boolean |
insert_Accounting(String acctTable,
String acctBaseTable,
String whereClause)
Insert Accounting Records |
boolean |
is_Changed()
Is there a Change to be saved? |
boolean |
is_KeyColumn(String columnName)
Is Column a Key Column? |
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 |
void |
load(int ID,
String trxName)
Load record with ID |
boolean |
load(Map<String,String> hmIn)
Load from HashMap. |
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. |
protected int |
saveNew_getID()
Get ID for new record during save. |
boolean |
saveNewInsertSQL()
Create Insert SQL and execute |
protected String |
saveNewSpecial(Object value,
int index)
Save Special Data. |
protected boolean |
saveUpdate()
Update Record directly |
void |
set_ChangeVO(ChangeVO change)
Set Change VO |
protected void |
set_ColumnUpdateable(int index,
boolean updateable)
Set Column Updateable |
void |
set_CustomColumn(String columnName,
Object value)
Set Custom Column |
void |
set_TrxName(String trxName)
Set Trx |
boolean |
set_Value(int index,
Object value)
Set Value if updateable and correct class. |
boolean |
set_Value(String ColumnName,
Object value)
Set Value |
protected boolean |
set_ValueE(String ColumnName,
Object value)
Set Encrypted Value |
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 |
protected String |
set_ValueString(int index,
String stringValue)
Set Value from String. |
void |
setAD_Client_ID(int AD_Client_ID)
Set AD_Client |
void |
setAD_Org_ID(int AD_Org_ID)
Set AD_Org |
void |
setClientOrg(int AD_Client_ID,
int AD_Org_ID)
Overwrite Client Org if different |
void |
setClientOrg(PO po)
Overwrite Client Org if different |
protected void |
setContext(int windowNo,
String columnName,
String value)
Sets the context in p_changeVO, if p_changeVO is not null |
protected void |
setCtx(Ctx ctx)
set Context |
static void |
setDocWorkflowMgr(DocWorkflowMgr docWFMgr)
Set Document Value Workflow Manager |
void |
setIsActive(boolean active)
Set Active |
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 info |
String |
toStringX()
Extended String info |
boolean |
unlock(String trxName)
UnLock it |
String |
update(Map<String,String> context)
Update PO based on string context |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final String ENTITYTYPE_UserMaintained
protected static final String ENTITYTYPE_Dictionary
protected transient CLogger log
protected volatile POInfo p_info
protected static final Integer I_ZERO
protected ChangeVO p_changeVO
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
public static final String XML_ATTRIBUTE_AD_Table_ID
public static final String XML_ATTRIBUTE_Record_ID
| Constructor Detail |
|---|
public PO(Ctx ctx)
ctx - context
public PO(Ctx ctx,
int ID,
String trxName)
ID - The unique ID of the objectctx - contexttrxName - transaction name
public PO(Ctx 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(Ctx ctx,
PO source,
int AD_Client_ID,
int AD_Org_ID)
ctx - contextsource - source objectAD_Client_ID - clientAD_Org_ID - org
public PO(Ctx ctx,
VO vo)
ctx - contextvo - value object| Method Detail |
|---|
public static PO copy(Ctx ctx,
PO po)
ctx - contextpo - PO
public static void setDocWorkflowMgr(DocWorkflowMgr docWFMgr)
docWFMgr - mgrpublic static int convertToInt(String stringValue)
stringValue - value
public static Timestamp convertToTimestamp(String stringValue)
stringValue - value
public static BigDecimal convertToBigDecimal(String stringValue)
stringValue - value
public static boolean convertToBoolean(String stringValue)
stringValue - value
public static int get_Table_ID(String tableName)
tableName - name
protected abstract POInfo initPO(Ctx ctx)
ctx - context
protected abstract int get_AccessLevel()
public POInfo get_Info()
public String toString()
toString in class Objectpublic String toStringX()
public boolean equals(Object cmp)
equals in interface Comparator<PO>equals in class Objectcmp - comparator
public int hashCode()
hashCode in class Object
public int compare(PO o1,
PO o2)
compare in interface Comparator<PO>o1 - Object 1o2 - Object 2
public String get_TableName()
public String[] get_KeyColumns()
public boolean is_KeyColumn(String columnName)
columnName - column name
public int get_Table_ID()
public int get_ID()
public int get_IDOld()
public Ctx 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
public final int get_ValueAsInt(String columnName)
columnName - column name
public String get_ValueAsString(String columnName)
get_ValueAsString in interface EvaluateecolumnName - name
public String[] get_ValuesAsString(String[] columnNames)
columnNames - column names
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
public 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
public final boolean set_Value(int index,
Object value)
index - indexvalue - value
public 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
protected String set_ValueString(int index,
String stringValue)
throws Exception
index - indexstringValue - value
Exception
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 void setCtx(Ctx ctx)
public int get_ColumnCount()
public 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 - updateablepublic 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 POpublic ChangeVO get_ChangeVO()
public void set_ChangeVO(ChangeVO change)
change - vo
public void load(int ID,
String trxName)
ID - IDtrxName - transaction namepublic boolean load(String trxName)
trxName - transaction
protected boolean load(ResultSet rs)
rs - result set
public boolean load(Map<String,String> hmIn)
hmIn - hash map
protected HashMap<String,String> get_HashMap()
public VO getVO()
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()
public 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()
public void setClientOrg(int AD_Client_ID,
int AD_Org_ID)
AD_Client_ID - clientAD_Org_ID - orgpublic 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 - userpublic String get_EntityType()
protected String get_Translation(String columnName,
String AD_Language)
columnName - AD_Language -
public boolean is_new()
public String update(Map<String,String> context)
context - row context
public boolean save()
public boolean save(String trxName)
trxName - transaction
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()
public boolean saveNewInsertSQL()
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 boolean delete(boolean force,
String trxName)
force - delete also processed recordstrxName - transaction
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
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 boolean addAttachment(URI uri)
uri - uri reference to be added
public boolean addAttachment(File file)
file - file to be loaded and added
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 StringBuffer get_xmlString(StringBuffer xml,
boolean dataOnly)
xml - optional string bufferdataOnly - if false, add value, label and info tags
public Document get_xmlDocument(boolean noComment,
boolean dataOnly)
noComment - do not add commentdataOnly - if false, add value, label and info tags
protected void setContext(int windowNo,
String columnName,
String value)
windowNo - windowcolumnName - columnvalue - valueprotected void addError(String message)
message - error info
|
Compiere 3.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||