Package org.compiere.model
Class PO_Record
java.lang.Object
org.compiere.model.PO_Record
Maintain AD_Table_ID/Record_ID constraint
- Version:
- $Id: PO_Record.java,v 1.4 2006/07/30 00:58:04 jjanke Exp $
- Author:
- Jorg Janke
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voiddeleteModelCascade(String tableName, Serializable Record_IDorUU, String trxName) Delete dependent records.
This is model class implementation of the delete cascade option of foreign key constraint.static voiddeleteModelCascade(String tableName, Serializable Record_IDorUU, String trxName, List<PO> deletes) Delete dependent records.
This is model class implementation of the delete cascade option of foreign key constraint.protected static booleandeleteRecordCascade(int AD_Table_ID, Serializable Record_IDorUU, String whereTables, String trxName) Delete Cascade including (selected)parent relationshipsprotected static booleandeleteRecordCascade(int AD_Table_ID, Serializable Record_IDorUU, String whereTables, String trxName, List<PO> deletes) Delete Cascade including (selected)parent relationshipsprotected static Stringexists(int AD_Table_ID, Serializable Record_IDorUU, String trxName) Check if dependent records with delete restrict condition exists for a table/record combination.static voidReset the KeyNamePair<AD_Table_ID, TableName> cache for constraint types + Record_ID/Record_UU reference idstatic voidsetRecordNull(int AD_Table_ID, Serializable Record_IDorUU, String trxName) If a referencing Record ID or Record UU exists to the deleted record, set it to NULL.
This is model class implementation of the set null option of foreign key constraint.static voidsetRecordNull(int AD_Table_ID, Serializable Record_IDorUU, String trxName, List<PO> updates) If a referencing Record ID or Record UU exists to the deleted record, set it to NULL.
This is model class implementation of the set null option of foreign key constraint.
-
Constructor Details
-
PO_Record
public PO_Record()
-
-
Method Details
-
resetCache
public static void resetCache()Reset the KeyNamePair<AD_Table_ID, TableName> cache for constraint types + Record_ID/Record_UU reference id -
deleteRecordCascade
protected static boolean deleteRecordCascade(int AD_Table_ID, Serializable Record_IDorUU, String whereTables, String trxName) Delete Cascade including (selected)parent relationships- Parameters:
AD_Table_ID- tableRecord_IDorUU- record ID (int) or UUID (String)whereTables- filter for the TablestrxName- transaction- Returns:
- false if could not be deleted
-
deleteRecordCascade
protected static boolean deleteRecordCascade(int AD_Table_ID, Serializable Record_IDorUU, String whereTables, String trxName, List<PO> deletes) Delete Cascade including (selected)parent relationships- Parameters:
AD_Table_ID- tableRecord_IDorUU- record ID (int) or UUID (String)whereTables- filter for the TablestrxName- transactiondeletes- if not null, the to be deleted PO record is added to the list instead of delete from DB- Returns:
- false if could not be deleted
-
deleteModelCascade
Delete dependent records.
This is model class implementation of the delete cascade option of foreign key constraint.- Parameters:
tableName-Record_IDorUU- record ID (int) or UUID (String)trxName-
-
deleteModelCascade
public static void deleteModelCascade(String tableName, Serializable Record_IDorUU, String trxName, List<PO> deletes) Delete dependent records.
This is model class implementation of the delete cascade option of foreign key constraint.- Parameters:
tableName-Record_IDorUU- record ID (int) or UUID (String)trxName-deletes- if not null, the to be deleted PO record is added to the list instead of delete from DB
-
setRecordNull
If a referencing Record ID or Record UU exists to the deleted record, set it to NULL.
This is model class implementation of the set null option of foreign key constraint.- Parameters:
AD_Table_ID-Record_IDorUU- record ID (int) or UUID (String)trxName-
-
setRecordNull
public static void setRecordNull(int AD_Table_ID, Serializable Record_IDorUU, String trxName, List<PO> updates) If a referencing Record ID or Record UU exists to the deleted record, set it to NULL.
This is model class implementation of the set null option of foreign key constraint.- Parameters:
AD_Table_ID-Record_IDorUU- record ID (int) or UUID (String)trxName-updates- if not null, the to be updated PO record is added to the list instead of saving to DB
-
exists
Check if dependent records with delete restrict condition exists for a table/record combination.- Parameters:
AD_Table_ID- tableRecord_IDorUU- record ID (int) or UUID (String)trxName- transaction- Returns:
- error message (Table Name) or null
-