diff --git a/com/Acrobot/Breeze/Database/Database.java b/com/Acrobot/Breeze/Database/Database.java index 56d2442..67ea7ab 100644 --- a/com/Acrobot/Breeze/Database/Database.java +++ b/com/Acrobot/Breeze/Database/Database.java @@ -33,8 +33,6 @@ public class Database { } /** - * @Deprecated - Not ready yet - * * Creates a table from a given class * * @param clazz Class with fields diff --git a/com/Acrobot/Breeze/Database/EntityParser.java b/com/Acrobot/Breeze/Database/EntityParser.java index c3b6238..5ce85e1 100644 --- a/com/Acrobot/Breeze/Database/EntityParser.java +++ b/com/Acrobot/Breeze/Database/EntityParser.java @@ -47,17 +47,17 @@ public class EntityParser { * @return SQL type */ public static String convertToSQL(Field field) { - String sqlType = ""; + String sqlType = field.getName(); Class type = field.getType(); if (type.isAssignableFrom(boolean.class)) { - sqlType += "BOOLEAN"; + sqlType += " BOOLEAN"; } else if (type.isAssignableFrom(int.class)) { - sqlType += "INTEGER"; + sqlType += " INTEGER"; } else if (type.isAssignableFrom(double.class) || type.isAssignableFrom(float.class)) { - sqlType += "REAL"; + sqlType += " REAL"; } else { - sqlType += "TEXT"; + sqlType += " TEXT"; } if (field.isAnnotationPresent(Id.class)) { diff --git a/com/Acrobot/Breeze/Database/Table.java b/com/Acrobot/Breeze/Database/Table.java index 1d9ec6b..58e628e 100644 --- a/com/Acrobot/Breeze/Database/Table.java +++ b/com/Acrobot/Breeze/Database/Table.java @@ -25,6 +25,13 @@ public class Table { this.name = name; } + /** + * Executes a select statement + * + * @param criteria Criteria to select + * @return RowSet of results + * @throws SQLException + */ private RowSet select(String criteria) throws SQLException { Connection connection = database.getConnection(); @@ -107,7 +114,7 @@ public class Table { * @throws SQLException exception */ public void insertRow(Row row, String condition) throws SQLException { - String statement = ""; + String statement; if (condition == null || condition.isEmpty()) { statement = String.format(INSERT_VALUES, row.stringOfValues());