Package org.compiere.model
Class MTable
- java.lang.Object
- 
- org.compiere.model.PO
- 
- org.compiere.model.X_AD_Table
- 
- org.compiere.model.MTable
 
 
 
- 
- All Implemented Interfaces:
- Serializable,- Cloneable,- Comparator<Object>,- I_AD_Table,- I_Persistent,- Evaluatee,- ImmutablePOSupport
 
 public class MTable extends X_AD_Table implements ImmutablePOSupport Persistent Table ModelChange log: - 2007-02-01 - teo_sarca - [ 1648850 ] MTable.getClass works incorrect for table "Fact_Acct"
 - 2007-08-30 - vpj-cd - [ 1784588 ] Use ModelPackage of EntityType to Find Model Class
 - Version:
- $Id: MTable.java,v 1.3 2006/07/30 00:58:04 jjanke Exp $
- Author:
- Jorg Janke, Teo Sarca, teo.sarca@gmail.com
                - BF [ 3017117 ] MTable.getClass returns bad class https://sourceforge.net/p/adempiere/bugs/2433/
- See Also:
- Serialized Form
 
- 
- 
Field SummaryFields Modifier and Type Field Description static intMAX_OFFICIAL_ID- 
Fields inherited from class org.compiere.model.X_AD_TableACCESSLEVEL_AD_Reference_ID, ACCESSLEVEL_All, ACCESSLEVEL_ClientOnly, ACCESSLEVEL_ClientPlusOrganization, ACCESSLEVEL_Organization, ACCESSLEVEL_SystemOnly, ACCESSLEVEL_SystemPlusClient, ENTITYTYPE_AD_Reference_ID, REPLICATIONTYPE_AD_Reference_ID, REPLICATIONTYPE_Broadcast, REPLICATIONTYPE_Local, REPLICATIONTYPE_Merge, REPLICATIONTYPE_Reference
 - 
Fields inherited from class org.compiere.model.POACCESSLEVEL_ALL, ACCESSLEVEL_CLIENT, ACCESSLEVEL_CLIENTORG, ACCESSLEVEL_ORG, ACCESSLEVEL_SYSTEM, ACCESSLEVEL_SYSTEMCLIENT, ENTITYTYPE_Dictionary, ENTITYTYPE_UserMaintained, I_ZERO, LOCAL_TRX_PREFIX, log, p_ctx, p_info, XML_ATTRIBUTE_AD_Table_ID, XML_ATTRIBUTE_Record_ID
 - 
Fields inherited from interface org.compiere.model.I_AD_TableaccessLevel, COLUMNNAME_AccessLevel, COLUMNNAME_AD_Client_ID, COLUMNNAME_AD_Org_ID, COLUMNNAME_AD_Table_ID, COLUMNNAME_AD_Table_UU, COLUMNNAME_AD_Val_Rule_ID, COLUMNNAME_AD_Window_ID, COLUMNNAME_CopyColumnsFromTable, COLUMNNAME_CopyComponentsFromView, COLUMNNAME_Created, COLUMNNAME_CreatedBy, COLUMNNAME_CreateWindowFromTable, COLUMNNAME_DatabaseViewDrop, COLUMNNAME_Description, COLUMNNAME_EntityType, COLUMNNAME_Help, COLUMNNAME_ImportTable, COLUMNNAME_IsActive, COLUMNNAME_IsCentrallyMaintained, COLUMNNAME_IsChangeLog, COLUMNNAME_IsDeleteable, COLUMNNAME_IsHighVolume, COLUMNNAME_IsSecurityEnabled, COLUMNNAME_IsView, COLUMNNAME_LoadSeq, COLUMNNAME_Name, COLUMNNAME_PO_Window_ID, COLUMNNAME_Processing, COLUMNNAME_ReplicationType, COLUMNNAME_TableName, COLUMNNAME_Updated, COLUMNNAME_UpdatedBy, Model, Table_ID, Table_Name
 
- 
 - 
Constructor SummaryConstructors Constructor Description MTable(Properties ctx, int AD_Table_ID, String trxName)Standard ConstructorMTable(Properties ctx, ResultSet rs, String trxName)Load ConstructorMTable(Properties ctx, MTable copy)MTable(Properties ctx, MTable copy, String trxName)MTable(MTable copy)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanafterSave(boolean newRecord, boolean success)After Saveprotected booleanbeforeSave(boolean newRecord)Before SavebooleancolumnExistsInDB(String ColumnName)Column exists and is not virtual?booleancolumnExistsInDictionary(String ColumnName)Column exists?QuerycreateQuery(String whereClause, String trxName)Create query to retrieve one or more PO.static MTableget(int AD_Table_ID)Get Table from Cache (immutable)static MTableget(Properties ctx, int AD_Table_ID)Get Table from Cache (immutable)static MTableget(Properties ctx, int AD_Table_ID, String trxName)Get Table from Cache (immutable)static MTableget(Properties ctx, String tableName)Get Table from Cachestatic MTableget(Properties ctx, String tableName, String trxName)Get Table from Cachestatic Class<?>getClass(String tableName)Get Persistence Class for TableMColumngetColumn(String columnName)Get ColumnintgetColumnIndex(int AD_Column_ID)Get Column IndexintgetColumnIndex(String ColumnName)Get Column IndexMColumn[]getColumns(boolean requery)Get Columnsstatic MTablegetCopy(Properties ctx, int AD_Table_ID, String trxName)Get updateable copy of MTable from cacheString[]getIdentifierColumns()Get Identifier Columns of TableString[]getKeyColumns()Get Key Columns of TablePOgetPO(int Record_ID, String trxName)Get PO Class InstancePOgetPO(String whereClause, Object[] params, String trxName)Get PO class instancePOgetPO(String whereClause, String trxName)Get PO Class InstancePOgetPO(ResultSet rs, String trxName)Get PO Class InstancePOgetPOByUU(String uuID, String trxName)Get PO Class InstanceStringgetSQLCreate()Get SQL Createstatic intgetTable_ID(String tableName)static intgetTable_ID(String tableName, String trxName)Grant independence to GenerateModel from AD_Table_IDstatic StringgetTableName(Properties ctx, int AD_Table_ID)Get Table NameMViewComponent[]getViewComponent(boolean reload)Get view componentsbooleanisSingleKey()Table has a single Keystatic booleanisZeroIDTable(String tablename)Verify if the table contains ID=0MTablemarkImmutable()mark PO as immutableStringtoString()String Representation- 
Methods inherited from class org.compiere.model.X_AD_Tableget_AccessLevel, getAccessLevel, getAD_Table_ID, getAD_Table_UU, getAD_Val_Rule, getAD_Val_Rule_ID, getAD_Window, getAD_Window_ID, getCopyColumnsFromTable, getCopyComponentsFromView, getCreateWindowFromTable, getDatabaseViewDrop, getDescription, getEntityType, getHelp, getImportTable, getKeyNamePair, getLoadSeq, getName, getPO_Window, getPO_Window_ID, getReplicationType, getTableName, initPO, isCentrallyMaintained, isChangeLog, isDeleteable, isHighVolume, isProcessing, isSecurityEnabled, isView, setAccessLevel, setAD_Table_ID, setAD_Table_UU, setAD_Val_Rule_ID, setAD_Window_ID, setCopyColumnsFromTable, setCopyComponentsFromView, setCreateWindowFromTable, setDatabaseViewDrop, setDescription, setEntityType, setHelp, setImportTable, setIsCentrallyMaintained, setIsChangeLog, setIsDeleteable, setIsHighVolume, setIsSecurityEnabled, setIsView, setLoadSeq, setName, setPO_Window_ID, setProcessing, setReplicationType, setTableName
 - 
Methods inherited from class org.compiere.model.POafterDelete, beforeDelete, checkImmutable, clearCrossTenantSafe, clone, columnExists, columnExists, compare, copyPO, copyValues, copyValues, createAttachment, delete, delete, delete_Accounting, delete_Tree, deleteEx, deleteEx, dump, dump, equals, get_Attribute, get_Attributes, get_ColumnCount, get_ColumnDescription, get_ColumnDisplayType, get_ColumnIndex, get_ColumnLabel, get_ColumnLookup, get_ColumnName, get_DisplayValue, get_HashMap, get_ID, get_IDOld, get_KeyColumns, get_Logger, get_OptimisticLockingColumns, get_Table_ID, get_TableName, get_Translation, get_Translation, get_Translation, get_Translation, get_Translation, get_TrxName, get_Value, get_Value, get_ValueAsBoolean, get_ValueAsInt, get_ValueAsInt, get_ValueAsString, get_ValueDifference, get_ValueDifference, get_ValueE, get_ValueOfColumn, get_ValueOld, get_ValueOld, get_ValueOldAsInt, get_WhereClause, get_WhereClause, get_xmlDocument, get_xmlString, getAD_Client_ID, getAD_Org_ID, getAllIDs, getAttachment, getAttachment, getAttachmentData, getCreated, getCreatedBy, getCtx, getDoc, getFindParameter, getPdfAttachment, getUpdated, getUpdatedBy, getUUIDColumnName, getUUIDColumnName, hashCode, insert_Accounting, insert_Tree, insert_Tree, is_Changed, is_Immutable, is_new, is_UseOptimisticLocking, is_ValueChanged, is_ValueChanged, isActive, isAttachment, isColumnMandatory, isColumnUpdateable, isMandatoryOK, isPdfAttachment, isReplication, load, load, load, load, load, loadByUU, loadComplete, loadDefaults, loadSpecial, lock, makeImmutable, postDelete, retrieveIdOfParentValue, retrieveIdOfParentValue, save, save, saveEx, saveEx, saveNew_afterSetID, saveNew_getID, saveNewSpecial, saveReplica, saveUpdate, set_Attribute, set_ColumnUpdateable, set_CustomColumn, set_CustomColumnReturningBoolean, set_OptimisticLockingColumns, set_TrxName, set_TrxName, set_UseOptimisticLocking, set_Value, set_Value, set_Value, set_Value, set_ValueE, set_ValueNoCheck, set_ValueNoCheckE, set_ValueOfColumn, set_ValueOfColumn, set_ValueOfColumnReturningBoolean, set_ValueOfColumnReturningBoolean, setAD_Client_ID, setAD_Org_ID, setClientOrg, setClientOrg, setCrossTenantSafe, setDoc, setDocWorkflowMgr, setIsActive, setProcessedOn, setReplication, setStandardDefaults, setUpdateable, setUpdatedBy, unlock, update_Tree, validForeignKeys
 - 
Methods inherited from class java.lang.Objectfinalize, getClass, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface java.util.Comparatorreversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
 - 
Methods inherited from interface org.compiere.model.I_AD_TablegetAD_Client_ID, getAD_Org_ID, getCreated, getCreatedBy, getUpdated, getUpdatedBy, isActive, setAD_Org_ID, setIsActive
 - 
Methods inherited from interface org.compiere.model.I_Persistentsave
 
- 
 
- 
- 
- 
Field Detail- 
MAX_OFFICIAL_IDpublic static final int MAX_OFFICIAL_ID - See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
MTablepublic MTable(Properties ctx, int AD_Table_ID, String trxName) Standard Constructor- Parameters:
- ctx- context
- AD_Table_ID- id
- trxName- transaction
 
 - 
MTablepublic MTable(Properties ctx, ResultSet rs, String trxName) Load Constructor- Parameters:
- ctx- context
- rs- result set
- trxName- transaction
 
 - 
MTablepublic MTable(MTable copy) - Parameters:
- copy-
 
 - 
MTablepublic MTable(Properties ctx, MTable copy) - Parameters:
- ctx-
- copy-
 
 - 
MTablepublic MTable(Properties ctx, MTable copy, String trxName) - Parameters:
- ctx-
- copy-
- trxName-
 
 
- 
 - 
Method Detail- 
getpublic static MTable get(int AD_Table_ID) Get Table from Cache (immutable)- Parameters:
- AD_Table_ID- id
- Returns:
- MTable
 
 - 
getpublic static MTable get(Properties ctx, int AD_Table_ID) Get Table from Cache (immutable)- Parameters:
- ctx- context
- AD_Table_ID- id
- Returns:
- MTable
 
 - 
getpublic static MTable get(Properties ctx, int AD_Table_ID, String trxName) Get Table from Cache (immutable)- Parameters:
- ctx- context
- AD_Table_ID- id
- trxName- transaction
- Returns:
- MTable
 
 - 
getCopypublic static MTable getCopy(Properties ctx, int AD_Table_ID, String trxName) Get updateable copy of MTable from cache- Parameters:
- ctx-
- AD_Table_ID-
- trxName-
- Returns:
- MTable
 
 - 
getpublic static MTable get(Properties ctx, String tableName) Get Table from Cache- Parameters:
- ctx- context
- tableName- case insensitive table name
- Returns:
- Table
 
 - 
getpublic static MTable get(Properties ctx, String tableName, String trxName) Get Table from Cache- Parameters:
- ctx- context
- tableName- case insensitive table name
- Returns:
- Table
 
 - 
getTableNamepublic static String getTableName(Properties ctx, int AD_Table_ID) Get Table Name- Parameters:
- ctx- context
- AD_Table_ID- table
- Returns:
- tavle name
 
 - 
getClasspublic static Class<?> getClass(String tableName) Get Persistence Class for Table- Parameters:
- tableName- table name
- Returns:
- class or null
 
 - 
getColumnspublic MColumn[] getColumns(boolean requery) Get Columns- Parameters:
- requery- requery
- Returns:
- array of columns
 
 - 
getColumnpublic MColumn getColumn(String columnName) Get Column- Parameters:
- columnName- (case insensitive)
- Returns:
- column if found
 
 - 
getColumnIndexpublic int getColumnIndex(String ColumnName) Get Column Index- Parameters:
- ColumnName- column name
- Returns:
- index of column with ColumnName or -1 if not found
 
 - 
columnExistsInDBpublic boolean columnExistsInDB(String ColumnName) Column exists and is not virtual?- Parameters:
- ColumnName- column name
- Returns:
- boolean - true indicating that the column exists in the table and is not virtual
 
 - 
columnExistsInDictionarypublic boolean columnExistsInDictionary(String ColumnName) Column exists?- Parameters:
- ColumnName- column name
- Returns:
- boolean - true indicating that the column exists in dictionary
 
 - 
getColumnIndexpublic int getColumnIndex(int AD_Column_ID) Get Column Index- Parameters:
- AD_Column_ID- column
- Returns:
- index of column with ColumnName or -1 if not found
 
 - 
isSingleKeypublic boolean isSingleKey() Table has a single Key- Returns:
- true if table has single key column
 
 - 
getKeyColumnspublic String[] getKeyColumns() Get Key Columns of Table- Returns:
- key columns
 
 - 
getIdentifierColumnspublic String[] getIdentifierColumns() Get Identifier Columns of Table- Returns:
- Identifier columns
 
 - 
getPOpublic PO getPO(int Record_ID, String trxName) Get PO Class Instance- Parameters:
- Record_ID- record
- trxName-
- Returns:
- PO for Record or null
 
 - 
getPOpublic PO getPO(ResultSet rs, String trxName) Get PO Class Instance- Parameters:
- rs- result set
- trxName- transaction
- Returns:
- PO for Record or null
 
 - 
getPOByUUpublic PO getPOByUU(String uuID, String trxName) Get PO Class Instance- Parameters:
- uuID- UUID
- trxName- transaction
- Returns:
- PO for Record
 
 - 
getPOpublic PO getPO(String whereClause, String trxName) Get PO Class Instance- Parameters:
- whereClause- where clause
- trxName- transaction
- Returns:
- PO for Record or null
 
 - 
getPOpublic PO getPO(String whereClause, Object[] params, String trxName) Get PO class instance- Parameters:
- whereClause-
- params-
- trxName-
- Returns:
 
 - 
beforeSaveprotected boolean beforeSave(boolean newRecord) Before Save- Overrides:
- beforeSavein class- PO
- Parameters:
- newRecord- new
- Returns:
- true
 
 - 
afterSaveprotected boolean afterSave(boolean newRecord, boolean success)After Save
 - 
getSQLCreatepublic String getSQLCreate() Get SQL Create- Returns:
- create table DDL
 
 - 
getTable_IDpublic static int getTable_ID(String tableName) 
 - 
getTable_IDpublic static int getTable_ID(String tableName, String trxName) Grant independence to GenerateModel from AD_Table_ID- Parameters:
- tableName- String
- trxName-
- Returns:
- int retValue
 
 - 
createQuerypublic Query createQuery(String whereClause, String trxName) Create query to retrieve one or more PO.- Parameters:
- whereClause-
- trxName-
- Returns:
- Query
 
 - 
getViewComponentpublic MViewComponent[] getViewComponent(boolean reload) Get view components- Parameters:
- reload- reload data
- Returns:
- array of view component
 
 - 
toStringpublic String toString() String Representation- Overrides:
- toStringin class- X_AD_Table
- Returns:
- info
 
 - 
isZeroIDTablepublic static boolean isZeroIDTable(String tablename) Verify if the table contains ID=0- Returns:
- true if table has zero ID
 
 - 
markImmutablepublic MTable markImmutable() Description copied from interface:ImmutablePOSupportmark PO as immutable- Specified by:
- markImmutablein interface- ImmutablePOSupport
- Returns:
- PO
 
 
- 
 
-