use of org.compiere.model.MTable in project adempiere by adempiere.
the class EnableNativeSequence method doIt.
// prepare
protected String doIt() {
boolean SYSTEM_NATIVE_SEQUENCE = MSysConfig.getBooleanValue("SYSTEM_NATIVE_SEQUENCE", false);
if (SYSTEM_NATIVE_SEQUENCE) {
throw new AdempiereException("Native Sequence is Actived");
}
setSystemNativeSequence(true);
boolean ok = false;
try {
createSequence("AD_Sequence", null);
createSequence("AD_Issue", null);
createSequence("AD_ChangeLog", null);
//
final String whereClause = "TableName NOT IN ('AD_Sequence', 'AD_Issue', 'AD_ChangeLog')";
List<MTable> tables = new Query(getCtx(), X_AD_Table.Table_Name, whereClause, get_TrxName()).setOrderBy("TableName").list();
for (MTable table : tables) {
createSequence(table, get_TrxName());
}
ok = true;
} finally {
if (!ok) {
setSystemNativeSequence(false);
}
}
return "@OK@";
}
use of org.compiere.model.MTable in project adempiere by adempiere.
the class Browser method deleteSelection.
/**
* Delete a Selection
* @param browseTable
* @return
*/
protected int deleteSelection(IBrowserTable browseTable) {
MTable table = null;
MBrowseField fieldKey = m_Browse.getFieldKey();
if (fieldKey != null)
if (fieldKey.getAD_View_Column().getAD_Column_ID() > 0)
table = (MTable) fieldKey.getAD_View_Column().getAD_Column().getAD_Table();
int records = 0;
for (int id : getSelectedRowKeys(browseTable)) {
if (table != null) {
table.getPO(id, null).deleteEx(true);
records++;
}
}
return records;
}
Aggregations