Current ADempiere use DB.getNextID for get next sequence vs MSequence.getNextID, so in the future the developer need use only DB.getNextID
This commit is contained in:
parent
e1cf4390fa
commit
cb40da8cc6
|
@ -100,7 +100,7 @@ public abstract class AbstractElementHandler implements ElementHandler {
|
|||
//String sql2 = "SELECT MAX(AD_PACKAGE_IMP_DETAIL_ID) FROM AD_PACKAGE_IMP_DETAIL";
|
||||
//int id = DB.getSQLValue(m_trxName, sql2)+1;
|
||||
|
||||
id = MSequence.getNextID (Env.getAD_Client_ID(ctx), "AD_Package_Imp_Detail", getTrxName(ctx));
|
||||
id = DB.getNextID (Env.getAD_Client_ID(ctx), "AD_Package_Imp_Detail", getTrxName(ctx));
|
||||
|
||||
StringBuffer sqlB = new StringBuffer ("Insert INTO AD_Package_Imp_Detail")
|
||||
.append( "(AD_Client_ID, AD_Org_ID, CreatedBy, UpdatedBy, " )
|
||||
|
@ -147,7 +147,7 @@ public abstract class AbstractElementHandler implements ElementHandler {
|
|||
//String sql2 = "SELECT MAX(AD_PACKAGE_IMP_DETAIL_ID) FROM AD_PACKAGE_IMP_DETAIL";
|
||||
//int id = DB.getSQLValue(m_trxName,sql2)+1;
|
||||
|
||||
id = MSequence.getNextID (Env.getAD_Client_ID(ctx), "AD_Package_Imp_Detail", getTrxName(ctx));
|
||||
id = DB.getNextID (Env.getAD_Client_ID(ctx), "AD_Package_Imp_Detail", getTrxName(ctx));
|
||||
|
||||
StringBuffer sqlB = new StringBuffer ("Insert INTO AD_Package_Imp_Detail")
|
||||
.append( "(AD_Client_ID, AD_Org_ID, CreatedBy, UpdatedBy, " )
|
||||
|
@ -249,7 +249,7 @@ public abstract class AbstractElementHandler implements ElementHandler {
|
|||
StringBuffer sqlD = new StringBuffer("SELECT AD_Reference_ID FROM AD_COLUMN WHERE AD_Column_ID = '"+columnID+"'");
|
||||
int referenceID = DB.getSQLValue(getTrxName(ctx),sqlD.toString());
|
||||
|
||||
idBackup = MSequence.getNextID (getClientId(ctx), "AD_Package_Imp_Backup", getTrxName(ctx));
|
||||
idBackup = DB.getNextID (getClientId(ctx), "AD_Package_Imp_Backup", getTrxName(ctx));
|
||||
|
||||
sqlD = new StringBuffer("SELECT MAX(AD_PACKAGE_IMP_DETAIL_ID) FROM AD_PACKAGE_IMP_DETAIL");
|
||||
int idDetail = DB.getSQLValue(getTrxName(ctx),sqlD.toString())+1;
|
||||
|
|
|
@ -314,7 +314,7 @@ public class PackInHandler extends DefaultHandler {
|
|||
+ "' AND PK_VERSION ='" + atts.getValue("Version") + "'";
|
||||
int PK_preInstalled = DB.getSQLValue(m_trxName,sql2);
|
||||
|
||||
AD_Package_Imp_ID = MSequence.getNextID (Env.getAD_Client_ID(m_ctx), "AD_Package_Imp", null);
|
||||
AD_Package_Imp_ID = DB.getNextID (Env.getAD_Client_ID(m_ctx), "AD_Package_Imp", null);
|
||||
|
||||
StringBuffer sqlB = new StringBuffer ("Insert INTO AD_Package_Imp")
|
||||
.append( "(AD_Client_ID, AD_Org_ID, CreatedBy, UpdatedBy, " )
|
||||
|
@ -344,7 +344,7 @@ public class PackInHandler extends DefaultHandler {
|
|||
log.info("Insert to Package import failed");
|
||||
|
||||
if ( PK_preInstalled == -1){
|
||||
AD_Package_Imp_Inst_ID = MSequence.getNextID (Env.getAD_Client_ID(m_ctx), "AD_Package_Imp_Inst", null);
|
||||
AD_Package_Imp_Inst_ID = DB.getNextID (Env.getAD_Client_ID(m_ctx), "AD_Package_Imp_Inst", null);
|
||||
|
||||
//Insert Package into package install log
|
||||
sqlB = new StringBuffer ("Insert INTO AD_Package_Imp_Inst")
|
||||
|
|
|
@ -127,7 +127,7 @@ public class CodeSnipitElementHandler extends AbstractElementHandler {
|
|||
int success = readReplace(targetDirectoryModified+sourceName, oldCode, newCode);
|
||||
|
||||
// Record in log
|
||||
int idBackup = MSequence.getNextID (getClientId(ctx), "AD_Package_Imp_Backup", getTrxName(ctx));
|
||||
int idBackup = DB.getNextID (getClientId(ctx), "AD_Package_Imp_Backup", getTrxName(ctx));
|
||||
if (success != -1){
|
||||
try {
|
||||
idDetail = record_log (ctx, 1, sourceName,"codesnipit", 0,0, Object_Status,sourceName,0);
|
||||
|
|
|
@ -139,7 +139,7 @@ public class DistFileElementHandler extends AbstractElementHandler {
|
|||
//Copy File
|
||||
int success = copyFile (inputStream,outputStream);
|
||||
//Record in log
|
||||
int idBackup = MSequence.getNextID (getClientId(ctx), "AD_Package_Imp_Backup", getTrxName(ctx));
|
||||
int idBackup = DB.getNextID (getClientId(ctx), "AD_Package_Imp_Backup", getTrxName(ctx));
|
||||
if (success != -1){
|
||||
try {
|
||||
idDetail = record_log (ctx, 1, fileName,"file", 0,0, Object_Status,fileName,0);
|
||||
|
|
|
@ -193,7 +193,7 @@ public class MenuElementHandler extends AbstractElementHandler {
|
|||
+ (columnID == -1 ? "null" : columnID));
|
||||
int referenceID = DB.getSQLValue(getTrxName(ctx), sql
|
||||
.toString());
|
||||
int idBackup = MSequence.getNextID(Env
|
||||
int idBackup = DB.getNextID(Env
|
||||
.getAD_Client_ID(ctx), "AD_Package_Imp_Backup",
|
||||
getTrxName(ctx));
|
||||
if (referenceID == 20 || referenceID == 28)
|
||||
|
|
|
@ -68,7 +68,7 @@ public class ProcessElementHandler extends AbstractElementHandler {
|
|||
Object_Status = "Update";
|
||||
} else {
|
||||
m_Process = new X_AD_Process(ctx, id, getTrxName(ctx));
|
||||
id = MSequence.getNextID(Env.getAD_Client_ID(ctx),
|
||||
id = DB.getNextID(Env.getAD_Client_ID(ctx),
|
||||
"AD_Process", getTrxName(ctx));
|
||||
m_Process.setAD_Process_ID(id);
|
||||
Object_Status = "New";
|
||||
|
|
|
@ -181,7 +181,7 @@ public class PrepareMigrationScripts extends SvrProcess {
|
|||
isFirstLine = false;
|
||||
}
|
||||
scanner.close();
|
||||
int seqID = MSequence.getNextID(0, "AD_MigrationScript", this
|
||||
int seqID = DB.getNextID(0, "AD_MigrationScript", this
|
||||
.get_TrxName());
|
||||
String sql = "INSERT INTO ad_migrationscript (ad_client_id, ad_org_id, "
|
||||
+ "ad_migrationscript_id, createdby, "
|
||||
|
|
|
@ -464,7 +464,7 @@ public class ServerBean implements SessionBean
|
|||
throw new RuntimeException("Transaction lost - " + trxName);
|
||||
}
|
||||
}
|
||||
int retValue = MSequence.getNextID (AD_Client_ID, TableName, trxName);
|
||||
int retValue = DB.getNextID (AD_Client_ID, TableName, trxName);
|
||||
log.finer("[" + m_no + "] " + TableName + " = " + retValue);
|
||||
m_nextSeqCount++;
|
||||
return retValue;
|
||||
|
|
Loading…
Reference in New Issue