12
0

get all schems of certain type

Dieser Commit ist enthalten in:
Lixfel 2019-04-20 21:54:43 +02:00
Ursprung 8dab3e2a88
Commit 7997703c0a

Datei anzeigen

@ -109,6 +109,23 @@ public class Schematic {
return null;
}
public static List<Schematic> getAllSchemsOfType(SchematicType schemType){
try{
ResultSet schematic = sql.select("SELECT * FROM Schematic WHERE SchemType = '" + schemType.name() + "'");
List<Schematic> schematics = new ArrayList<>();
while(schematic.next()){
int schemOwner = schematic.getInt("SchemOwner");
String schemName = schematic.getString("SchemName");
String item = schematic.getString("Item");
schematics.add(new Schematic(schemName, schemOwner, item, schemType, false));
}
return schematics;
}catch(SQLException e){
e.printStackTrace();
}
return null;
}
public String getSchemName() {
return SchemName;
}