Schematic Nodes #90
@ -55,9 +55,9 @@ public class SchematicNode {
|
||||
parent = null;
|
||||
ResultSet set;
|
||||
if(parent == null) {
|
||||
set = SQL.select("SELECT NodeId, NodeName, NodeOwner, ParentNode, NodeType, NodeItem FROM SchematicNode WHERE NodeOwner = ? AND NodeName = ? AND ParentNode is NULL", owner, name);
|
||||
set = SQL.select("SELECT NodeId, NodeName, NodeOwner, ParentNode, NodeType, NodeItem, NodeRank FROM SchematicNode WHERE NodeOwner = ? AND NodeName = ? AND ParentNode is NULL", owner, name);
|
||||
}else {
|
||||
set = SQL.select("SELECT NodeId, NodeName, NodeOwner, ParentNode, NodeType, NodeItem FROM SchematicNode WHERE NodeOwner = ? AND NodeName = ? AND ParentNode = ?", owner, name, parent);
|
||||
set = SQL.select("SELECT NodeId, NodeName, NodeOwner, ParentNode, NodeType, NodeItem, NodeRank FROM SchematicNode WHERE NodeOwner = ? AND NodeName = ? AND ParentNode = ?", owner, name, parent);
|
||||
}
|
||||
try {
|
||||
while (set.next()) {
|
||||
@ -85,9 +85,9 @@ public class SchematicNode {
|
||||
parent = null;
|
||||
ResultSet set;
|
||||
if(parent == null) {
|
||||
set = SQL.select("SELECT NodeId, NodeName, NodeOwner, ParentNode, NodeType, NodeItem FROM SchematicNode WHERE ParentNode is NULL");
|
||||
set = SQL.select("SELECT NodeId, NodeName, NodeOwner, ParentNode, NodeType, NodeItem, NodeRank FROM SchematicNode WHERE ParentNode is NULL");
|
||||
}else {
|
||||
set = SQL.select("SELECT NodeId, NodeName, NodeOwner, ParentNode, NodeType, NodeItem FROM SchematicNode WHERE ParentNode = ?", parent);
|
||||
set = SQL.select("SELECT NodeId, NodeName, NodeOwner, ParentNode, NodeType, NodeItem, NodeRank FROM SchematicNode WHERE ParentNode = ?", parent);
|
||||
}
|
||||
try {
|
||||
List<SchematicNode> nodes = new ArrayList<>();
|
||||
@ -112,9 +112,9 @@ public class SchematicNode {
|
||||
parent = null;
|
||||
ResultSet set;
|
||||
if(parent == null) {
|
||||
set = SQL.select("SELECT NodeId, NodeName, NodeOwner, ParentNode, NodeType, NodeItem FROM SchematicNode WHERE NodeName = ? AND ParentNode is NULL", name, parent);
|
||||
set = SQL.select("SELECT NodeId, NodeName, NodeOwner, ParentNode, NodeType, NodeItem, NodeRank FROM SchematicNode WHERE NodeName = ? AND ParentNode is NULL", name, parent);
|
||||
}else {
|
||||
set = SQL.select("SELECT NodeId, NodeName, NodeOwner, ParentNode, NodeType, NodeItem FROM SchematicNode WHERE NodeName = ? AND ParentNode = ?", name, parent);
|
||||
set = SQL.select("SELECT NodeId, NodeName, NodeOwner, ParentNode, NodeType, NodeItem, NodeRank FROM SchematicNode WHERE NodeName = ? AND ParentNode = ?", name, parent);
|
||||
}
|
||||
try {
|
||||
while (set.next()) {
|
||||
@ -133,9 +133,9 @@ public class SchematicNode {
|
||||
parent = null;
|
||||
ResultSet set;
|
||||
if(parent == null) {
|
||||
set = SQL.select("SELECT * FROM SchematicNode WHERE NodeName = ? AND ParentNode is NULL", name, parent);
|
||||
set = SQL.select("SELECT NodeId, NodeName, NodeOwner, ParentNode, NodeType, NodeItem, NodeRank FROM SchematicNode WHERE NodeName = ? AND ParentNode is NULL", name, parent);
|
||||
}else {
|
||||
set = SQL.select("SELECT * FROM SchematicNode WHERE NodeName = ? AND ParentNode = ?", name, parent);
|
||||
set = SQL.select("SELECT NodeId, NodeName, NodeOwner, ParentNode, NodeType, NodeItem, NodeRank FROM SchematicNode WHERE NodeName = ? AND ParentNode = ?", name, parent);
|
||||
}
|
||||
try {
|
||||
while (set.next()) {
|
||||
@ -150,7 +150,7 @@ public class SchematicNode {
|
||||
}
|
||||
|
||||
public static SchematicNode getSchematicNode(int id) {
|
||||
ResultSet set = SQL.select("SELECT NodeId, NodeName, NodeOwner, ParentNode, NodeType, NodeItem FROM SchematicNode WHERE NodeId = ?", id);
|
||||
ResultSet set = SQL.select("SELECT NodeId, NodeName, NodeOwner, ParentNode, NodeType, NodeItem, NodeRank FROM SchematicNode WHERE NodeId = ?", id);
|
||||
try {
|
||||
if(!set.next())
|
||||
return null;
|
||||
@ -161,7 +161,7 @@ public class SchematicNode {
|
||||
}
|
||||
|
||||
public static List<SchematicNode> getAllSchematicsOfType(int owner, String schemType) {
|
||||
ResultSet set = SQL.select("SELECT NodeId, NodeName, NodeOwner, ParentNode, NodeType, NodeItem FROM SchematicNode WHERE NodeOwner = ? AND NodeType = ?", owner, schemType);
|
||||
ResultSet set = SQL.select("SELECT NodeId, NodeName, NodeOwner, ParentNode, NodeType, NodeItem, NodeRank FROM SchematicNode WHERE NodeOwner = ? AND NodeType = ?", owner, schemType);
|
||||
try {
|
||||
List<SchematicNode> nodes = new ArrayList<>();
|
||||
while (set.next())
|
||||
@ -173,7 +173,7 @@ public class SchematicNode {
|
||||
}
|
||||
|
||||
public static List<SchematicNode> getAllSchematicsOfType(String schemType) {
|
||||
ResultSet set = SQL.select("SELECT NodeId, NodeName, NodeOwner, ParentNode, NodeType, NodeItem FROM SchematicNode WHERE NodeType = ?", schemType);
|
||||
ResultSet set = SQL.select("SELECT NodeId, NodeName, NodeOwner, ParentNode, NodeType, NodeItem, NodeRank FROM SchematicNode WHERE NodeType = ?", schemType);
|
||||
try {
|
||||
List<SchematicNode> nodes = new ArrayList<>();
|
||||
while (set.next())
|
||||
@ -214,7 +214,7 @@ public class SchematicNode {
|
||||
if(isAdded)
|
||||
return getSchematicNodeInNode(parent);
|
||||
} else {
|
||||
ResultSet set = SQL.select("SELECT s.NodeId, s.NodeName, s.NodeOwner, s.NodeItem, s.NodeType, s.ParentNode FROM SchematicNode s LEFT JOIN NodeMember n ON s.NodeId = n.NodeId WHERE (s.NodeOwner = ? OR n.UserId = ?) AND s.ParentNode is NULL GROUP BY s.NodeId ORDER BY s.NodeName", user, user);
|
||||
ResultSet set = SQL.select("SELECT s.NodeId, s.NodeName, s.NodeOwner, s.NodeItem, s.NodeType, s.ParentNode, s.NodeRank FROM SchematicNode s LEFT JOIN NodeMember n ON s.NodeId = n.NodeId WHERE (s.NodeOwner = ? OR n.UserId = ?) AND s.ParentNode is NULL GROUP BY s.NodeId ORDER BY s.NodeName", user, user);
|
||||
try{
|
||||
List<SchematicNode> nodes = new ArrayList<>();
|
||||
while(set.next())
|
||||
@ -228,7 +228,7 @@ public class SchematicNode {
|
||||
}
|
||||
|
||||
public static List<SchematicNode> getAllSchematicsAccessibleByUser(int user) {
|
||||
ResultSet set = SQL.select("SELECT s.NodeId, s.NodeName, s.NodeOwner, s.NodeItem, s.NodeType, s.ParentNode FROM SchematicNode s LEFT JOIN NodeMember nm ON nm.NodeId = s.NodeId WHERE s.NodeOwner = ? OR nm.UserId = ? GROUP BY s.NodeId ORDER BY s.NodeName", user, user);
|
||||
ResultSet set = SQL.select("SELECT s.NodeId, s.NodeName, s.NodeOwner, s.NodeItem, s.NodeType, s.ParentNode, s.NodeRank FROM SchematicNode s LEFT JOIN NodeMember nm ON nm.NodeId = s.NodeId WHERE s.NodeOwner = ? OR nm.UserId = ? GROUP BY s.NodeId ORDER BY s.NodeName", user, user);
|
||||
try{
|
||||
List<SchematicNode> nodes = new ArrayList<>();
|
||||
while(set.next())
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren