[cleanup] Refactor needed to delete the AD_Treebar table
authorVíctor Martínez Romanos <victor.martinez@openbravo.com>
Tue, 10 May 2011 16:55:21 +0200
changeset 12107 f9343faf73b8
parent 12106 aa63d51a7b54
child 12108 ede029961157
[cleanup] Refactor needed to delete the AD_Treebar table
src/org/openbravo/base/secureApp/OrgTree.java
src/org/openbravo/erpCommon/utility/WindowTreeUtility.java
src/org/openbravo/erpCommon/utility/WindowTree_data.xsql
--- a/src/org/openbravo/base/secureApp/OrgTree.java	Tue May 10 16:35:05 2011 +0200
+++ b/src/org/openbravo/base/secureApp/OrgTree.java	Tue May 10 16:55:21 2011 +0200
@@ -35,7 +35,7 @@
   public OrgTree(ConnectionProvider conn, String strClient) {
     try {
       String treeID = WindowTreeData.selectTreeID(conn, "'" + strClient + "'", "OO")[0].id;
-      WindowTreeData[] data = WindowTreeData.selectOrg(conn, "", "", "", "", treeID);
+      WindowTreeData[] data = WindowTreeData.selectOrg(conn, "", "", "", treeID);
       this.nodes = OrgTreeNode.createTree(data);
     } catch (Exception e) {
       e.printStackTrace();
--- a/src/org/openbravo/erpCommon/utility/WindowTreeUtility.java	Tue May 10 16:35:05 2011 +0200
+++ b/src/org/openbravo/erpCommon/utility/WindowTreeUtility.java	Tue May 10 16:55:21 2011 +0200
@@ -108,40 +108,33 @@
     WindowTreeData[] data = null;
     String strEditable = (editable ? "editable" : "");
     if (TreeType.equals("MM")) {
-      data = WindowTreeData.selectTrl(conn, vars.getUser(), vars.getLanguage(), strEditable,
-          strParentID, strNodeId, TreeID);
+      data = WindowTreeData.selectTrl(conn, vars.getLanguage(), strEditable, strParentID,
+          strNodeId, TreeID);
     } else if (TreeType.equals("OO"))
-      data = WindowTreeData.selectOrg(conn, vars.getUser(), strEditable, strParentID, strNodeId,
-          TreeID);
+      data = WindowTreeData.selectOrg(conn, strEditable, strParentID, strNodeId, TreeID);
     else if (TreeType.equals("PC"))
-      data = WindowTreeData.selectProductCategory(conn, vars.getUser(), strEditable, strParentID,
-          strNodeId, TreeID);
+      data = WindowTreeData
+          .selectProductCategory(conn, strEditable, strParentID, strNodeId, TreeID);
     else if (TreeType.equals("BB"))
-      data = WindowTreeData.selectBOM(conn, vars.getUser(), strEditable, strParentID, strNodeId,
-          TreeID);
+      data = WindowTreeData.selectBOM(conn, strEditable, strParentID, strNodeId, TreeID);
     else if (TreeType.equals("EV")) {
       String strElementId = vars.getSessionValue(Utility.getWindowID(conn, strTabID)
           + "|C_Element_ID");
-      data = WindowTreeData.selectElementValue(conn, vars.getLanguage(), vars.getUser(),
-          strEditable, strParentID, strNodeId, TreeID, strElementId);
+      data = WindowTreeData.selectElementValue(conn, vars.getLanguage(), strEditable, strParentID,
+          strNodeId, TreeID, strElementId);
     } else if (TreeType.equals("MC"))
-      data = WindowTreeData.selectCampaign(conn, vars.getUser(), strEditable, strParentID,
-          strNodeId, TreeID);
+      data = WindowTreeData.selectCampaign(conn, strEditable, strParentID, strNodeId, TreeID);
     else if (TreeType.equals("PJ"))
-      data = WindowTreeData.selectProject(conn, vars.getUser(), strEditable, strParentID,
-          strNodeId, TreeID);
+      data = WindowTreeData.selectProject(conn, strEditable, strParentID, strNodeId, TreeID);
     else if (TreeType.equals("AY"))
-      data = WindowTreeData.selectActivity(conn, vars.getUser(), strEditable, strParentID,
-          strNodeId, TreeID);
+      data = WindowTreeData.selectActivity(conn, strEditable, strParentID, strNodeId, TreeID);
     else if (TreeType.equals("SR"))
-      data = WindowTreeData.selectSalesRegion(conn, vars.getUser(), strEditable, strParentID,
-          strNodeId, TreeID);
+      data = WindowTreeData.selectSalesRegion(conn, strEditable, strParentID, strNodeId, TreeID);
     else if (TreeType.equals("AR"))
-      data = WindowTreeData.selectAccountingReport(conn, vars.getUser(), strEditable, strParentID,
-          strNodeId, TreeID);
+      data = WindowTreeData.selectAccountingReport(conn, strEditable, strParentID, strNodeId,
+          TreeID);
     else if (TreeType.equals("TR"))
-      data = WindowTreeData.selectTaxReport(conn, vars.getUser(), strEditable, strParentID,
-          strNodeId, TreeID);
+      data = WindowTreeData.selectTaxReport(conn, strEditable, strParentID, strNodeId, TreeID);
 
     return data;
   }
@@ -159,7 +152,6 @@
     aux.nodeId = data.getField("nodeId");
     aux.parentId = data.getField("parentId");
     aux.seqno = data.getField("seqno");
-    aux.isactive = data.getField("isactive");
     aux.id = data.getField("id");
     aux.name = data.getField("name");
     aux.description = data.getField("description");
--- a/src/org/openbravo/erpCommon/utility/WindowTree_data.xsql	Tue May 10 16:35:05 2011 +0200
+++ b/src/org/openbravo/erpCommon/utility/WindowTree_data.xsql	Tue May 10 16:55:21 2011 +0200
@@ -27,15 +27,13 @@
    <SqlMethod name="select" type="preparedStatement" return="multiple">
       <SqlMethodComment></SqlMethodComment>
       <Sql>
-        SELECT tn.Node_ID,tn.Parent_ID,tn.SeqNo,tb.IsActive, m.AD_Menu_ID AS ID, m.Name,m.Description,m.IsSummary,
+        SELECT tn.Node_ID,tn.Parent_ID,tn.SeqNo, m.AD_Menu_ID AS ID, m.Name,m.Description,m.IsSummary,
         m.Action, m.AD_Window_ID, m.AD_Process_ID, m.AD_Form_ID,
         (case when (select count(*) from ad_module where type='T' and isindevelopment='Y')=0 
                then Mo.ISINDEVELOPMENT 
                else 'Y' end) as isInDevelopment, 
         '' as IsReady, '' as AD_OrgType_ID
-        FROM AD_TreeNode tn left join AD_TreeBar tb on tn.AD_Tree_ID=tb.AD_Tree_ID 
-                                                  AND tn.Node_ID=tb.Node_ID 
-                                                  AND tb.AD_User_ID  = ?,          
+        FROM AD_TreeNode tn,          
              AD_Menu m,
              AD_Module Mo
         WHERE tn.Node_ID = m.AD_Menu_ID 
@@ -43,7 +41,6 @@
         AND Mo.AD_Module_ID = m.AD_Module_ID
         ORDER BY COALESCE(tn.Parent_ID, '-1'), tn.SeqNo
       </Sql>
-        <Parameter name="adUserId"/>
         <Parameter name="editable" optional="true" type="none" after="WHERE " text="tn.IsActive='Y' AND m.isActive='Y' AND "/>
         <Parameter name="parentId" optional="true" after="WHERE " text="tn.Parent_ID = ? AND "/>
         <Parameter name="nodeId" optional="true" after="WHERE " text="tn.Node_ID = ? AND "/>
@@ -52,15 +49,13 @@
    <SqlMethod name="selectTrl" type="preparedStatement" return="multiple">
       <SqlMethodComment></SqlMethodComment>
       <Sql>
-        SELECT tn.Node_ID,tn.Parent_ID,tn.SeqNo,tb.IsActive, m.AD_Menu_ID AS ID, 
+        SELECT tn.Node_ID,tn.Parent_ID,tn.SeqNo, m.AD_Menu_ID AS ID, 
                COALESCE (t.Name, m.Name) as name,t.Description,m.IsSummary,
         m.Action, m.AD_Window_ID, m.AD_Process_ID, m.AD_Form_ID,
         (case when (select count(*) from ad_module where type='T' and isindevelopment='Y')=0 
                then Mo.ISINDEVELOPMENT 
                else 'Y' end) as isInDevelopment
-        FROM AD_TreeNode tn left join AD_TreeBar tb on tn.AD_Tree_ID=tb.AD_Tree_ID  
-                                                      AND tn.Node_ID=tb.Node_ID
-                                                      AND tb.AD_User_ID  = ? , 
+        FROM AD_TreeNode tn, 
              AD_Menu m left join AD_Menu_Trl t on m.AD_Menu_ID = t.AD_Menu_ID 
                                                AND t.AD_Language = ?
                                                AND m.AD_Menu_ID = t.AD_Menu_ID,
@@ -70,7 +65,6 @@
         AND Mo.AD_Module_ID = m.AD_Module_ID
         ORDER BY COALESCE(tn.Parent_ID, '-1'), tn.SeqNo
       </Sql>
-        <Parameter name="adUserId"/>
         <Parameter name="adLanguage"/>
         <Parameter name="editable" optional="true" type="none" after="WHERE " text="tn.IsActive='Y' AND m.isActive='Y' AND "/>
         <Parameter name="parentId" optional="true" after="WHERE " text="tn.Parent_ID = ? AND "/>
@@ -80,16 +74,13 @@
    <SqlMethod name="selectOrg" type="preparedStatement" return="multiple">
       <SqlMethodComment></SqlMethodComment>
       <Sql>
-        SELECT tn.Node_ID,tn.Parent_ID,tn.SeqNo,tb.IsActive, m.AD_Org_ID AS ID, m.Name,m.Description,m.IsSummary,m.IsReady, m.AD_OrgType_ID
-        FROM AD_TreeNode tn left join AD_TreeBar tb on tn.AD_Tree_ID=tb.AD_Tree_ID 
-                                            AND tn.Node_ID=tb.Node_ID 
-                                            AND tb.AD_User_ID  = ? ,
+        SELECT tn.Node_ID,tn.Parent_ID,tn.SeqNo, m.AD_Org_ID AS ID, m.Name,m.Description,m.IsSummary,m.IsReady, m.AD_OrgType_ID
+        FROM AD_TreeNode tn,
          AD_Org m
         WHERE tn.Node_ID = m.AD_Org_ID 
         AND tn.AD_Tree_ID = ? 
         ORDER BY COALESCE(tn.Parent_ID, '-1'), tn.SeqNo
       </Sql>
-        <Parameter name="adUserId"/>
         <Parameter name="editable" optional="true" type="none" after="WHERE " text="tn.IsActive='Y' AND m.isActive='Y' AND "/>
         <Parameter name="parentId" optional="true" after="WHERE " text="tn.Parent_ID = ? AND "/>
         <Parameter name="nodeId" optional="true" after="WHERE " text="tn.Node_ID = ? AND "/>
@@ -98,16 +89,13 @@
    <SqlMethod name="selectProductCategory" type="preparedStatement" return="multiple">
       <SqlMethodComment></SqlMethodComment>
       <Sql>
-        SELECT tn.Node_ID,tn.Parent_ID,tn.SeqNo,tb.IsActive, m.M_Product_Category_ID AS ID, m.Name,m.Description, 'N' AS IsSummary 
-        FROM AD_TreeNode tn left join AD_TreeBar tb on tn.AD_Tree_ID=tb.AD_Tree_ID  
-                                            AND tn.Node_ID=tb.Node_ID 
-                                            AND tb.AD_User_ID  = ? , 
+        SELECT tn.Node_ID,tn.Parent_ID,tn.SeqNo, m.M_Product_Category_ID AS ID, m.Name,m.Description, 'N' AS IsSummary 
+        FROM AD_TreeNode tn, 
           M_Product_Category m
         WHERE tn.Node_ID = m.M_Product_Category_ID 
         AND tn.AD_Tree_ID = ? 
         ORDER BY COALESCE(tn.Parent_ID, '-1'), tn.SeqNo
       </Sql>
-        <Parameter name="adUserId"/>
         <Parameter name="editable" optional="true" type="none" after="WHERE " text="tn.IsActive='Y' AND m.isActive='Y' AND "/>
         <Parameter name="parentId" optional="true" after="WHERE " text="tn.Parent_ID = ? AND "/>
         <Parameter name="nodeId" optional="true" after="WHERE " text="tn.Node_ID = ? AND "/>
@@ -116,17 +104,14 @@
    <SqlMethod name="selectBOM" type="preparedStatement" return="multiple">
       <SqlMethodComment></SqlMethodComment>
       <Sql>
-        SELECT tn.Node_ID,tn.Parent_ID,tn.SeqNo,tb.IsActive, m.M_Product_BOM_ID AS ID, p.Name,p.Description, p.IsBOM AS IsSummary 
-        FROM AD_TreeNode tn left join AD_TreeBar tb on  tn.AD_Tree_ID=tb.AD_Tree_ID 
-                                AND tn.Node_ID=tb.Node_ID 
-                                AND tb.AD_User_ID = ? , 
+        SELECT tn.Node_ID,tn.Parent_ID,tn.SeqNo, m.M_Product_BOM_ID AS ID, p.Name,p.Description, p.IsBOM AS IsSummary 
+        FROM AD_TreeNode tn, 
           M_Product_BOM m, M_Product p
         WHERE tn.Node_ID = m.M_Product_BOM_ID 
         AND m.M_ProductBOM_ID = p.M_Product_ID 
         AND tn.AD_Tree_ID = ? 
         ORDER BY COALESCE(tn.Parent_ID, '-1'), tn.SeqNo
       </Sql>
-        <Parameter name="adUserId"/>
         <Parameter name="editable" optional="true" type="none" after="WHERE " text="tn.IsActive='Y' AND m.isActive='Y' AND "/>
         <Parameter name="parentId" optional="true" after="WHERE " text="tn.Parent_ID = ? AND "/>
         <Parameter name="nodeId" optional="true" after="WHERE " text="tn.Node_ID = ? AND "/>
@@ -135,20 +120,17 @@
    <SqlMethod name="selectElementValue" type="preparedStatement" return="multiple">
       <SqlMethodComment></SqlMethodComment>
       <Sql>
-        SELECT tn.Node_ID,tn.Parent_ID,tn.SeqNo,tb.IsActive, m.C_ElementValue_ID AS ID, 
+        SELECT tn.Node_ID,tn.Parent_ID,tn.SeqNo, m.C_ElementValue_ID AS ID, 
                 m.value||' - '||coalesce(mt.name, m.name) as Name,m.Description,m.IsSummary 
         FROM C_ElementValue m left join c_elementvalue_trl mt on mt.c_elementvalue_id = m.c_elementvalue_id
                                   and mt.ad_language = ?,
-             AD_TreeNode tn left join AD_TreeBar tb on tn.AD_Tree_ID=tb.AD_Tree_ID 
-                                AND tn.Node_ID=tb.Node_ID 
-                                AND tb.AD_User_ID = ?  
+             AD_TreeNode tn
         WHERE tn.Node_ID = m.C_ElementValue_ID 
         AND tn.AD_Tree_ID = ? 
         AND m.C_Element_ID = ? 
         ORDER BY COALESCE(tn.Parent_ID, '-1'), tn.SeqNo
       </Sql>
 	  	<Parameter name="adLanguage"/>
-        <Parameter name="adUserId"/>
         <Parameter name="editable" optional="true" type="none" after="WHERE " text="tn.IsActive='Y' AND m.isActive='Y' AND "/>
         <Parameter name="parentId" optional="true" after="WHERE " text="tn.Parent_ID = ? AND "/>
         <Parameter name="nodeId" optional="true" after="WHERE " text="tn.Node_ID = ? AND "/>
@@ -158,16 +140,13 @@
    <SqlMethod name="selectCampaign" type="preparedStatement" return="multiple">
       <SqlMethodComment></SqlMethodComment>
       <Sql>
-        SELECT tn.Node_ID,tn.Parent_ID,tn.SeqNo,tb.IsActive, m.C_Campaign_ID AS ID, m.Name,m.Description, 'N' AS IsSummary 
-        FROM AD_TreeNode tn left join AD_TreeBar tb on tn.AD_Tree_ID=tb.AD_Tree_ID 
-                            AND tn.Node_ID=tb.Node_ID 
-                            AND tb.AD_User_ID = ? , 
+        SELECT tn.Node_ID,tn.Parent_ID,tn.SeqNo, m.C_Campaign_ID AS ID, m.Name,m.Description, 'N' AS IsSummary 
+        FROM AD_TreeNode tn, 
               C_Campaign m
         WHERE  tn.Node_ID = m.C_Campaign_ID 
         AND tn.AD_Tree_ID = ? 
         ORDER BY COALESCE(tn.Parent_ID, '-1'), tn.SeqNo
       </Sql>
-        <Parameter name="adUserId"/>
         <Parameter name="editable" optional="true" type="none" after="WHERE " text="tn.IsActive='Y' AND m.isActive='Y' AND "/>
         <Parameter name="parentId" optional="true" after="WHERE " text="tn.Parent_ID = ? AND "/>
         <Parameter name="nodeId" optional="true" after="WHERE " text="tn.Node_ID = ? AND "/>
@@ -176,16 +155,12 @@
    <SqlMethod name="selectProject" type="preparedStatement" return="multiple">
       <SqlMethodComment></SqlMethodComment>
       <Sql>
-        SELECT tn.Node_ID,tn.Parent_ID,tn.SeqNo,tb.IsActive, m.C_Project_ID AS ID, m.Name,m.Description,m.IsSummary 
-        FROM AD_TreeNode tn left join AD_TreeBar tb on  tn.AD_Tree_ID=tb.AD_Tree_ID 
-                            AND tn.Node_ID=tb.Node_ID 
-                            AND tb.AD_User_ID  = ?  , 
-              C_Project m
+        SELECT tn.Node_ID,tn.Parent_ID,tn.SeqNo, m.C_Project_ID AS ID, m.Name,m.Description,m.IsSummary 
+        FROM AD_TreeNode tn, C_Project m
         WHERE tn.Node_ID = m.C_Project_ID 
         AND tn.AD_Tree_ID = ? 
         ORDER BY COALESCE(tn.Parent_ID, '-1'), tn.SeqNo
       </Sql>
-        <Parameter name="adUserId"/>
         <Parameter name="editable" optional="true" type="none" after="WHERE " text="tn.IsActive='Y' AND m.isActive='Y' AND "/>
         <Parameter name="parentId" optional="true" after="WHERE " text="tn.Parent_ID = ? AND "/>
         <Parameter name="nodeId" optional="true" after="WHERE " text="tn.Node_ID = ? AND "/>
@@ -194,16 +169,12 @@
    <SqlMethod name="selectActivity" type="preparedStatement" return="multiple">
       <SqlMethodComment></SqlMethodComment>
       <Sql>
-        SELECT tn.Node_ID,tn.Parent_ID,tn.SeqNo,tb.IsActive, m.C_Activity_ID AS ID, m.Name,m.Description,m.IsSummary 
-        FROM AD_TreeNode tn left join AD_TreeBar tb on tn.AD_Tree_ID=tb.AD_Tree_ID 
-                            AND tn.Node_ID=tb.Node_ID 
-                            AND tb.AD_User_ID  = ?  , 
-                        C_Activity m
+        SELECT tn.Node_ID,tn.Parent_ID,tn.SeqNo, m.C_Activity_ID AS ID, m.Name,m.Description,m.IsSummary 
+        FROM AD_TreeNode tn, C_Activity m
         WHERE  tn.Node_ID = m.C_Activity_ID 
         AND tn.AD_Tree_ID = ? 
         ORDER BY COALESCE(tn.Parent_ID, '-1'), tn.SeqNo
       </Sql>
-        <Parameter name="adUserId"/>
         <Parameter name="editable" optional="true" type="none" after="WHERE " text="tn.IsActive='Y' AND m.isActive='Y' AND "/>
         <Parameter name="parentId" optional="true" after="WHERE " text="tn.Parent_ID = ? AND "/>
         <Parameter name="nodeId" optional="true" after="WHERE " text="tn.Node_ID = ? AND "/>
@@ -212,16 +183,12 @@
    <SqlMethod name="selectSalesRegion" type="preparedStatement" return="multiple">
       <SqlMethodComment></SqlMethodComment>
       <Sql>
-        SELECT tn.Node_ID,tn.Parent_ID,tn.SeqNo,tb.IsActive, m.C_SalesRegion_ID AS ID, m.Name,m.Description,m.IsSummary 
-        FROM AD_TreeNode tn left join AD_TreeBar tb on  tn.AD_Tree_ID=tb.AD_Tree_ID
-                                  AND tn.Node_ID=tb.Node_ID 
-                                  AND tb.AD_User_ID = ?  , 
-            C_SalesRegion m
+        SELECT tn.Node_ID,tn.Parent_ID,tn.SeqNo, m.C_SalesRegion_ID AS ID, m.Name,m.Description,m.IsSummary 
+        FROM AD_TreeNode tn, C_SalesRegion m
         WHERE tn.Node_ID = m.C_SalesRegion_ID 
         AND tn.AD_Tree_ID = ? 
         ORDER BY COALESCE(tn.Parent_ID, '-1'), tn.SeqNo
       </Sql>
-        <Parameter name="adUserId"/>
         <Parameter name="editable" optional="true" type="none" after="WHERE " text="tn.IsActive='Y' AND m.isActive='Y' AND "/>
         <Parameter name="parentId" optional="true" after="WHERE " text="tn.Parent_ID = ? AND "/>
         <Parameter name="nodeId" optional="true" after="WHERE " text="tn.Node_ID = ? AND "/>
@@ -230,16 +197,12 @@
    <SqlMethod name="selectAccountingReport" type="preparedStatement" return="multiple">
       <SqlMethodComment></SqlMethodComment>
       <Sql>
-        SELECT tn.Node_ID,tn.Parent_ID,tn.SeqNo,tb.IsActive, ar.AD_AccountingRpt_Element_ID AS ID, ar.Name,ar.Description,ar.IsSummary 
-        FROM AD_TreeNode tn left join AD_TreeBar tb on  tn.AD_Tree_ID=tb.AD_Tree_ID
-                                  AND tn.Node_ID=tb.Node_ID 
-                                  AND tb.AD_User_ID = ?  , 
-            AD_AccountingRpt_Element ar
+        SELECT tn.Node_ID,tn.Parent_ID,tn.SeqNo, ar.AD_AccountingRpt_Element_ID AS ID, ar.Name,ar.Description,ar.IsSummary 
+        FROM AD_TreeNode tn, AD_AccountingRpt_Element ar
         WHERE tn.Node_ID = ar.AD_AccountingRpt_Element_ID 
         AND tn.AD_Tree_ID = ? 
         ORDER BY COALESCE(tn.Parent_ID, '-1'), tn.SeqNo
       </Sql>
-        <Parameter name="adUserId"/>
         <Parameter name="editable" optional="true" type="none" after="WHERE " text="tn.IsActive='Y' AND ar.isActive='Y' AND "/>
         <Parameter name="parentId" optional="true" after="WHERE " text="tn.Parent_ID = ? AND "/>
         <Parameter name="nodeId" optional="true" after="WHERE " text="tn.Node_ID = ? AND "/>
@@ -248,16 +211,12 @@
    <SqlMethod name="selectTaxReport" type="preparedStatement" return="multiple">
       <SqlMethodComment></SqlMethodComment>
       <Sql>
-        SELECT tn.Node_ID,tn.Parent_ID,tn.SeqNo,tb.IsActive, tr.C_TAX_REPORT_ID AS ID, tr.NAME,tr.Description,tr.IsSummary 
-        FROM AD_TREENODE tn LEFT JOIN AD_TREEBAR tb ON  tn.AD_Tree_ID=tb.AD_Tree_ID
-                                  AND tn.Node_ID=tb.Node_ID 
-                                  AND tb.AD_User_ID = ?  , 
-            C_TAX_REPORT tr
+        SELECT tn.Node_ID,tn.Parent_ID,tn.SeqNo, tr.C_TAX_REPORT_ID AS ID, tr.NAME,tr.Description,tr.IsSummary 
+        FROM AD_TREENODE tn, C_TAX_REPORT tr
         WHERE tn.Node_ID = tr.C_TAX_REPORT_ID
         AND tn.AD_Tree_ID = ? 
         ORDER BY COALESCE(tn.Parent_ID, '-1'), tn.SeqNo
       </Sql>
-        <Parameter name="adUserId"/>
         <Parameter name="editable" optional="true" type="none" after="WHERE " text="tn.IsActive='Y' AND tr.isActive='Y' AND "/>
         <Parameter name="parentId" optional="true" after="WHERE " text="tn.Parent_ID = ? AND "/>
         <Parameter name="nodeId" optional="true" after="WHERE " text="tn.Node_ID = ? AND "/>