[ 2101466 ] Implement Native Sequence Functionality
http://sourceforge.net/tracker/index.php?func=detail&aid=2101466&group_id=176962&atid=879335
This commit is contained in:
parent
140f908199
commit
2be32a8b88
|
@ -198,6 +198,19 @@ public interface AdempiereDatabase
|
|||
public String TO_NUMBER (BigDecimal number, int displayType);
|
||||
|
||||
|
||||
/**
|
||||
* Return next sequence this Sequence
|
||||
* @param Sequence Name
|
||||
*/
|
||||
public int getNextID(String Name);
|
||||
|
||||
/*
|
||||
* Create Native Sequence
|
||||
* @param Sequence Name
|
||||
*/
|
||||
public boolean createSequence(String name , int increment , int minvalue , int maxvalue ,int start);
|
||||
|
||||
|
||||
/** Create User commands */
|
||||
public static final int CMD_CREATE_USER = 0;
|
||||
/** Create Database/Schema Commands */
|
||||
|
|
|
@ -1085,5 +1085,24 @@ public class DB_Oracle implements AdempiereDatabase
|
|||
return m_convert;
|
||||
}
|
||||
|
||||
public int getNextID(String Name) {
|
||||
int m_sequence_id = DB.getSQLValue(null, "SELECT "+Name.toUpperCase()+".nextid FROM DUAL");
|
||||
return m_sequence_id;
|
||||
}
|
||||
|
||||
public boolean createSequence(String name , int increment , int minvalue , int maxvalue ,int start)
|
||||
{
|
||||
|
||||
int no = DB.executeUpdate("CREATE SEQUENCE "+name.toUpperCase()
|
||||
+ " INCREMENT BY " + increment
|
||||
+ " START WITH " + start
|
||||
+ " MIN VALUE " + minvalue
|
||||
+ " MAX VALUE " + maxvalue, null);
|
||||
if(no == -1 )
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
} // DB_Oracle
|
||||
|
|
|
@ -34,6 +34,7 @@ import javax.sql.RowSet;
|
|||
import org.compiere.dbPort.Convert;
|
||||
import org.compiere.dbPort.Convert_PostgreSQL;
|
||||
import org.compiere.util.CLogger;
|
||||
import org.compiere.util.DB;
|
||||
import org.compiere.util.DisplayType;
|
||||
import org.compiere.util.Ini;
|
||||
|
||||
|
@ -762,6 +763,26 @@ public class DB_PostgreSQL implements AdempiereDatabase
|
|||
}
|
||||
} // main
|
||||
|
||||
public int getNextID(String name) {
|
||||
|
||||
int m_sequence_id = DB.getSQLValue(null, "SELECT nextval('"+name.toLowerCase()+"')");
|
||||
return m_sequence_id;
|
||||
}
|
||||
|
||||
public boolean createSequence(String name , int increment , int minvalue , int maxvalue ,int start)
|
||||
{
|
||||
|
||||
int no = DB.executeUpdate("CREATE SEQUENCE "+name.toUpperCase()
|
||||
+ " INCREMENT " + increment
|
||||
+ " MINVALUE " + minvalue
|
||||
+ " MAXVALUE " + maxvalue
|
||||
+ " START " + start , null);
|
||||
if(no == -1 )
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
public boolean getSupportAlias()
|
||||
{
|
||||
|
|
|
@ -21,7 +21,12 @@ import java.util.Vector;
|
|||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import org.compiere.model.MSysConfig;
|
||||
import org.compiere.util.CLogger;
|
||||
import org.compiere.util.DB;
|
||||
import org.compiere.util.Env;
|
||||
import org.compiere.util.Ini;
|
||||
import org.compiere.util.Util;
|
||||
|
||||
/**
|
||||
|
@ -75,6 +80,32 @@ public class Convert_PostgreSQL extends Convert_SQL92 {
|
|||
/** Vector to save previous values of quoted strings **/
|
||||
Vector<String> retVars = new Vector<String>();
|
||||
|
||||
//Validate Next ID Function and use Native Sequence if the functionality is active
|
||||
int found_next_fuction = sqlStatement.toUpperCase().indexOf("NEXTIDFUNC(");
|
||||
if(found_next_fuction<=0)
|
||||
found_next_fuction = sqlStatement.toUpperCase().indexOf("NEXTID(");
|
||||
if(found_next_fuction > 0)
|
||||
{
|
||||
boolean SYSTEM_NATIVE_SEQUENCE = MSysConfig.getBooleanValue("SYSTEM_NATIVE_SEQUENCE",true,Env.getAD_Client_ID(Env.getCtx()));
|
||||
boolean adempiereSys = Ini.isPropertyBool(Ini.P_ADEMPIERESYS);
|
||||
|
||||
if(SYSTEM_NATIVE_SEQUENCE && !adempiereSys)
|
||||
{
|
||||
String function_before = sqlStatement.substring(0,found_next_fuction);
|
||||
String function_start = sqlStatement.substring(found_next_fuction);
|
||||
String function_after = function_start.substring(function_start.indexOf(")") + 1);
|
||||
String sequence = function_start.substring(function_start.indexOf("(") + 1, function_start.indexOf(","));
|
||||
int separator = function_start.indexOf("'") + 1;
|
||||
String next = function_start.substring(separator);
|
||||
String system = next.substring(0,next.indexOf("'"));
|
||||
if (system.equals("N"))
|
||||
{
|
||||
String seq_name = DB.getSQLValueString(null, "SELECT Name FROM AD_Sequence WHERE AD_Sequence_ID=" + sequence);
|
||||
sqlStatement = function_before + " nextval('"+seq_name+ "_seq') " + function_after;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String statement = replaceQuotedStrings(sqlStatement, retVars);
|
||||
statement = convertWithConvertMap(statement);
|
||||
|
||||
|
|
|
@ -938,6 +938,28 @@ public class MSequence extends X_AD_Sequence
|
|||
*/
|
||||
public static boolean createTableSequence (Properties ctx, String TableName, String trxName)
|
||||
{
|
||||
boolean SYSTEM_NATIVE_SEQUENCE = MSysConfig.getBooleanValue("SYSTEM_NATIVE_SEQUENCE",true,Env.getAD_Client_ID(Env.getCtx()));
|
||||
|
||||
if(SYSTEM_NATIVE_SEQUENCE)
|
||||
{
|
||||
int next_id = MSequence.getNextID(Env.getAD_Client_ID(ctx), TableName, trxName);
|
||||
if(next_id == -1)
|
||||
{
|
||||
MSequence seq = new MSequence (ctx, 0, trxName);
|
||||
seq.setClientOrg(0, 0);
|
||||
seq.setName(TableName);
|
||||
seq.setDescription("Table " + TableName);
|
||||
seq.setIsTableID(true);
|
||||
seq.save();
|
||||
next_id = 1000000;
|
||||
}
|
||||
|
||||
if(CConnection.get().getDatabase().createSequence(TableName+"_SEQ", 1, 0 , 9999999, next_id))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
MSequence seq = new MSequence (ctx, 0, trxName);
|
||||
seq.setClientOrg(0, 0);
|
||||
seq.setName(TableName);
|
||||
|
|
|
@ -49,6 +49,7 @@ import org.compiere.model.MAcctSchema;
|
|||
import org.compiere.model.MLanguage;
|
||||
import org.compiere.model.MRole;
|
||||
import org.compiere.model.MSequence;
|
||||
import org.compiere.model.MSysConfig;
|
||||
import org.compiere.model.MSystem;
|
||||
import org.compiere.model.PO;
|
||||
import org.compiere.model.POResultSet;
|
||||
|
@ -1492,6 +1493,15 @@ public final class DB
|
|||
*/
|
||||
public static int getNextID (int AD_Client_ID, String TableName, String trxName)
|
||||
{
|
||||
boolean SYSTEM_NATIVE_SEQUENCE = MSysConfig.getBooleanValue("SYSTEM_NATIVE_SEQUENCE",false,AD_Client_ID);
|
||||
boolean adempiereSys = Ini.isPropertyBool(Ini.P_ADEMPIERESYS);
|
||||
|
||||
if(SYSTEM_NATIVE_SEQUENCE && !adempiereSys)
|
||||
{
|
||||
int m_sequence_id = CConnection.get().getDatabase().getNextID(TableName+"_SEQ");
|
||||
return m_sequence_id;
|
||||
}
|
||||
|
||||
return MSequence.getNextID (AD_Client_ID, TableName, trxName);
|
||||
} // getNextID
|
||||
|
||||
|
|
|
@ -0,0 +1,207 @@
|
|||
-- Sep 8, 2008 10:12:30 PM CDT
|
||||
-- DB Native Sequence
|
||||
INSERT INTO AD_SysConfig (AD_Client_ID,AD_Org_ID,AD_SysConfig_ID,ConfigurationLevel,Created,CreatedBy,Description,EntityType,IsActive,Name,Updated,UpdatedBy,Value) VALUES (0,0,50016,'S',TO_DATE('2008-09-08 22:12:21','YYYY-MM-DD HH24:MI:SS'),0,'Y - Yes Use Native Sequence , N - No Use Adempiere Sequence (AD_Sequence)','D','Y','SYSTEM_NATIVE_SEQUENCE',TO_DATE('2008-09-08 22:12:21','YYYY-MM-DD HH24:MI:SS'),0,'N')
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:22:39 PM CDT
|
||||
-- DB Native Sequence
|
||||
INSERT INTO AD_Process (AD_Client_ID,AD_Org_ID,AD_Process_ID,AccessLevel,Classname,Created,CreatedBy,Description,EntityType,Help,IsActive,IsBetaFunctionality,IsDirectPrint,IsReport,IsServerProcess,Name,ShowHelp,Statistic_Count,Statistic_Seconds,Updated,UpdatedBy,Value) VALUES (0,0,53156,'4','org.eevolution.process.EnableNativeSequence',TO_DATE('2008-09-08 22:22:38','YYYY-MM-DD HH24:MI:SS'),0,'Enable Native Sequence','D','This process allows Enable the native sequences based in the current AD_Sequence.
|
||||
|
||||
This process should be implemented when the users are not connected.','Y','N','N','N','N','Enable Native Sequence','Y',5,181,TO_DATE('2008-09-08 22:22:38','YYYY-MM-DD HH24:MI:SS'),0,'AD_Native_Sequence_Enable')
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:22:39 PM CDT
|
||||
-- DB Native Sequence
|
||||
INSERT INTO AD_Process_Trl (AD_Language,AD_Process_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_ID=53156 AND EXISTS (SELECT * FROM AD_Process_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Process_ID!=t.AD_Process_ID)
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:22:39 PM CDT
|
||||
-- DB Native Sequence
|
||||
INSERT INTO AD_Process_Access (AD_Client_ID,AD_Org_ID,AD_Process_ID,AD_Role_ID,Created,CreatedBy,IsActive,Updated,UpdatedBy) VALUES (0,0,53156,0,TO_DATE('2008-09-08 22:22:39','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2008-09-08 22:22:39','YYYY-MM-DD HH24:MI:SS'),0)
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:22:39 PM CDT
|
||||
-- DB Native Sequence
|
||||
INSERT INTO AD_Process_Access (AD_Client_ID,AD_Org_ID,AD_Process_ID,AD_Role_ID,Created,CreatedBy,IsActive,Updated,UpdatedBy) VALUES (0,0,53156,102,TO_DATE('2008-09-08 22:22:39','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2008-09-08 22:22:39','YYYY-MM-DD HH24:MI:SS'),0)
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:22:39 PM CDT
|
||||
-- DB Native Sequence
|
||||
INSERT INTO AD_Process_Access (AD_Client_ID,AD_Org_ID,AD_Process_ID,AD_Role_ID,Created,CreatedBy,IsActive,Updated,UpdatedBy) VALUES (0,0,53156,103,TO_DATE('2008-09-08 22:22:39','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2008-09-08 22:22:39','YYYY-MM-DD HH24:MI:SS'),0)
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:22:39 PM CDT
|
||||
-- DB Native Sequence
|
||||
INSERT INTO AD_Process_Access (AD_Client_ID,AD_Org_ID,AD_Process_ID,AD_Role_ID,Created,CreatedBy,IsActive,Updated,UpdatedBy) VALUES (0,0,53156,50002,TO_DATE('2008-09-08 22:22:39','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2008-09-08 22:22:39','YYYY-MM-DD HH24:MI:SS'),0)
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:22:39 PM CDT
|
||||
-- DB Native Sequence
|
||||
INSERT INTO AD_Process_Access (AD_Client_ID,AD_Org_ID,AD_Process_ID,AD_Role_ID,Created,CreatedBy,IsActive,Updated,UpdatedBy) VALUES (0,0,53156,50001,TO_DATE('2008-09-08 22:22:39','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2008-09-08 22:22:39','YYYY-MM-DD HH24:MI:SS'),0)
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:04 PM CDT
|
||||
-- DB Native Sequence
|
||||
INSERT INTO AD_Menu (AD_Client_ID,AD_Menu_ID,AD_Org_ID,AD_Process_ID,Action,Created,CreatedBy,Description,EntityType,IsActive,IsReadOnly,IsSOTrx,IsSummary,Name,Updated,UpdatedBy) VALUES (0,53193,0,53156,'P',TO_DATE('2008-09-08 22:24:03','YYYY-MM-DD HH24:MI:SS'),0,'Enable Native Sequence','D','Y','N','N','N','Enable Native Sequence',TO_DATE('2008-09-08 22:24:03','YYYY-MM-DD HH24:MI:SS'),0)
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:04 PM CDT
|
||||
-- DB Native Sequence
|
||||
INSERT INTO AD_Menu_Trl (AD_Language,AD_Menu_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Menu_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Menu t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Menu_ID=53193 AND EXISTS (SELECT * FROM AD_Menu_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Menu_ID!=t.AD_Menu_ID)
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:04 PM CDT
|
||||
-- DB Native Sequence
|
||||
INSERT INTO AD_TreeNodeMM (AD_Client_ID,AD_Org_ID, IsActive,Created,CreatedBy,Updated,UpdatedBy, AD_Tree_ID, Node_ID, Parent_ID, SeqNo) SELECT t.AD_Client_ID,0, 'Y', SysDate, 0, SysDate, 0,t.AD_Tree_ID, 53193, 0, 999 FROM AD_Tree t WHERE t.AD_Client_ID=0 AND t.IsActive='Y' AND t.IsAllNodes='Y' AND t.TreeType='MM' AND NOT EXISTS (SELECT * FROM AD_TreeNodeMM e WHERE e.AD_Tree_ID=t.AD_Tree_ID AND Node_ID=53193)
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=0, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=218
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=1, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=153
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=2, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=263
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=3, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=166
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=4, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=203
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=5, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=236
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=6, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=183
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=7, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=160
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=8, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=278
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=9, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=345
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=10, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53014
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=11, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53108
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=12, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53083
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=155, SeqNo=0, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=161
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=155, SeqNo=1, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=367
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=155, SeqNo=2, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=456
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=155, SeqNo=3, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=501
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=155, SeqNo=4, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=326
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=155, SeqNo=5, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=566
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=155, SeqNo=6, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=392
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=155, SeqNo=7, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=113
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=155, SeqNo=8, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=220
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=155, SeqNo=9, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=351
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=155, SeqNo=10, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=289
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=155, SeqNo=11, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=302
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=155, SeqNo=12, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=303
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=155, SeqNo=13, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=321
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=155, SeqNo=14, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=461
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=155, SeqNo=15, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53193
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=155, SeqNo=16, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=383
|
||||
;
|
||||
|
|
@ -0,0 +1,197 @@
|
|||
-- Sep 8, 2008 10:12:30 PM CDT
|
||||
-- DB Native Sequence
|
||||
INSERT INTO AD_SysConfig (AD_Client_ID,AD_Org_ID,AD_SysConfig_ID,ConfigurationLevel,Created,CreatedBy,Description,EntityType,IsActive,Name,Updated,UpdatedBy,Value) VALUES (0,0,50016,'S',TO_TIMESTAMP('2008-09-08 22:12:21','YYYY-MM-DD HH24:MI:SS'),0,'Y - Yes Use Native Sequence , N - No Use Adempiere Sequence (AD_Sequence)','D','Y','SYSTEM_NATIVE_SEQUENCE',TO_TIMESTAMP('2008-09-08 22:12:21','YYYY-MM-DD HH24:MI:SS'),0,'N')
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:22:39 PM CDT
|
||||
-- DB Native Sequence
|
||||
INSERT INTO AD_Process (AD_Client_ID,AD_Org_ID,AD_Process_ID,AccessLevel,Classname,Created,CreatedBy,Description,EntityType,Help,IsActive,IsBetaFunctionality,IsDirectPrint,IsReport,IsServerProcess,Name,ShowHelp,Statistic_Count,Statistic_Seconds,Updated,UpdatedBy,Value) VALUES (0,0,53156,'4','org.eevolution.process.EnableNativeSequence',TO_TIMESTAMP('2008-09-08 22:22:38','YYYY-MM-DD HH24:MI:SS'),0,'Enable Native Sequence','D','This process allows Enable the native sequences based in the current AD_Sequence.
|
||||
|
||||
This process should be implemented when the users are not connected.','Y','N','N','N','N','Enable Native Sequence','Y',5,181,TO_TIMESTAMP('2008-09-08 22:22:38','YYYY-MM-DD HH24:MI:SS'),0,'AD_Native_Sequence_Enable')
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:22:39 PM CDT
|
||||
-- DB Native Sequence
|
||||
INSERT INTO AD_Process_Trl (AD_Language,AD_Process_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_ID=53156 AND EXISTS (SELECT * FROM AD_Process_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Process_ID!=t.AD_Process_ID)
|
||||
;
|
||||
|
||||
|
||||
-- Sep 8, 2008 10:22:39 PM CDT
|
||||
-- DB Native Sequence
|
||||
INSERT INTO AD_Process_Access (AD_Client_ID,AD_Org_ID,AD_Process_ID,AD_Role_ID,Created,CreatedBy,IsActive,Updated,UpdatedBy) VALUES (0,0,53156,0,TO_TIMESTAMP('2008-09-08 22:22:39','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2008-09-08 22:22:39','YYYY-MM-DD HH24:MI:SS'),0)
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:22:39 PM CDT
|
||||
-- DB Native Sequence
|
||||
INSERT INTO AD_Process_Access (AD_Client_ID,AD_Org_ID,AD_Process_ID,AD_Role_ID,Created,CreatedBy,IsActive,Updated,UpdatedBy) VALUES (0,0,53156,102,TO_TIMESTAMP('2008-09-08 22:22:39','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2008-09-08 22:22:39','YYYY-MM-DD HH24:MI:SS'),0)
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:22:39 PM CDT
|
||||
-- DB Native Sequence
|
||||
INSERT INTO AD_Process_Access (AD_Client_ID,AD_Org_ID,AD_Process_ID,AD_Role_ID,Created,CreatedBy,IsActive,Updated,UpdatedBy) VALUES (0,0,53156,103,TO_TIMESTAMP('2008-09-08 22:22:39','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2008-09-08 22:22:39','YYYY-MM-DD HH24:MI:SS'),0)
|
||||
;
|
||||
-- Sep 8, 2008 10:24:04 PM CDT
|
||||
-- DB Native Sequence
|
||||
INSERT INTO AD_Menu (AD_Client_ID,AD_Menu_ID,AD_Org_ID,AD_Process_ID,"action",Created,CreatedBy,Description,EntityType,IsActive,IsReadOnly,IsSOTrx,IsSummary,Name,Updated,UpdatedBy) VALUES (0,53193,0,53156,'P',TO_TIMESTAMP('2008-09-08 22:24:03','YYYY-MM-DD HH24:MI:SS'),0,'Enable Native Sequence','D','Y','N','N','N','Enable Native Sequence',TO_TIMESTAMP('2008-09-08 22:24:03','YYYY-MM-DD HH24:MI:SS'),0)
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:04 PM CDT
|
||||
-- DB Native Sequence
|
||||
INSERT INTO AD_Menu_Trl (AD_Language,AD_Menu_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Menu_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Menu t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Menu_ID=53193 AND EXISTS (SELECT * FROM AD_Menu_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Menu_ID!=t.AD_Menu_ID)
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:04 PM CDT
|
||||
-- DB Native Sequence
|
||||
INSERT INTO AD_TreeNodeMM (AD_Client_ID,AD_Org_ID, IsActive,Created,CreatedBy,Updated,UpdatedBy, AD_Tree_ID, Node_ID, Parent_ID, SeqNo) SELECT t.AD_Client_ID,0, 'Y', CURRENT_TIMESTAMP, 0, CURRENT_TIMESTAMP, 0,t.AD_Tree_ID, 53193, 0, 999 FROM AD_Tree t WHERE t.AD_Client_ID=0 AND t.IsActive='Y' AND t.IsAllNodes='Y' AND t.TreeType='MM' AND NOT EXISTS (SELECT * FROM AD_TreeNodeMM e WHERE e.AD_Tree_ID=t.AD_Tree_ID AND Node_ID=53193)
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=0, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=218
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=1, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=153
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=2, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=263
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=3, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=166
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=4, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=203
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=5, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=236
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=6, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=183
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=7, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=160
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=8, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=278
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=9, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=345
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=10, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53014
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=11, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53108
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=0, SeqNo=12, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53083
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=155, SeqNo=0, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=161
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=155, SeqNo=1, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=367
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=155, SeqNo=2, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=456
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=155, SeqNo=3, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=501
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=155, SeqNo=4, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=326
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=155, SeqNo=5, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=566
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=155, SeqNo=6, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=392
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=155, SeqNo=7, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=113
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=155, SeqNo=8, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=220
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=155, SeqNo=9, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=351
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=155, SeqNo=10, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=289
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=155, SeqNo=11, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=302
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=155, SeqNo=12, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=303
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=155, SeqNo=13, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=321
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=155, SeqNo=14, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=461
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=155, SeqNo=15, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53193
|
||||
;
|
||||
|
||||
-- Sep 8, 2008 10:24:14 PM CDT
|
||||
-- DB Native Sequence
|
||||
UPDATE AD_TreeNodeMM SET Parent_ID=155, SeqNo=16, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=383
|
||||
;
|
||||
|
Loading…
Reference in New Issue