SchemMember bugfix
Dieser Commit ist enthalten in:
Ursprung
0b2248de9a
Commit
c0ecde6fd4
@ -49,8 +49,12 @@ public class Schematic {
|
|||||||
ResultSet schematic = sql.select("SELECT * FROM Schematic WHERE SchemName = '" + schemName + "' AND SchemOwner = '" + schemOwner + "'");
|
ResultSet schematic = sql.select("SELECT * FROM Schematic WHERE SchemName = '" + schemName + "' AND SchemOwner = '" + schemOwner + "'");
|
||||||
try {
|
try {
|
||||||
if(schematic == null || !schematic.next()){
|
if(schematic == null || !schematic.next()){
|
||||||
|
SchematicMember member = SchematicMember.getMemberBySchematic(schemName, schemOwner);
|
||||||
|
if(member == null){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
return getSchemFromDB(schemName, member.getSchemOwner());
|
||||||
|
}
|
||||||
String item = schematic.getString("Item");
|
String item = schematic.getString("Item");
|
||||||
SchematicType schemType = SchematicType.valueOf(schematic.getString("SchemType"));
|
SchematicType schemType = SchematicType.valueOf(schematic.getString("SchemType"));
|
||||||
return new Schematic(schemName, schemOwner, item, schemType, false);
|
return new Schematic(schemName, schemOwner, item, schemType, false);
|
||||||
@ -133,5 +137,6 @@ public class Schematic {
|
|||||||
|
|
||||||
public void remove(){
|
public void remove(){
|
||||||
sql.update("DELETE FROM Schematic WHERE SchemOwner = " + SchemOwner + " AND SchemName = '" + SchemName + "'");
|
sql.update("DELETE FROM Schematic WHERE SchemOwner = " + SchemOwner + " AND SchemName = '" + SchemName + "'");
|
||||||
|
sql.update("DELETE FROM SchemMember WHERE SchemOwner = " + SchemOwner + " AND SchemName = '" + SchemName + "'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -53,6 +53,20 @@ public class SchematicMember {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static SchematicMember getMemberBySchematic(String schemName, int schemMember){
|
||||||
|
ResultSet schematicMember = sql.select("SELECT * FROM SchemMember WHERE SchemName = '" + schemName + "' AND Member = '" + schemMember + "'");
|
||||||
|
try {
|
||||||
|
if(schematicMember == null || !schematicMember.next()){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
int schemOwner = schematicMember.getInt("SchemOwner");
|
||||||
|
return new SchematicMember(schemName, schemOwner, schemMember, false);
|
||||||
|
} catch (SQLException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public static List<SchematicMember> getSchemMembers(String schemName, UUID schemOwner){
|
public static List<SchematicMember> getSchemMembers(String schemName, UUID schemOwner){
|
||||||
return getSchemMembers(schemName, WarkingUser.get(schemOwner).getId());
|
return getSchemMembers(schemName, WarkingUser.get(schemOwner).getId());
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren