fix again table column name escaping
This commit is contained in:
parent
4773999dd6
commit
d0a80abd41
@ -248,7 +248,7 @@ public abstract class SQLElement<E extends SQLElement<E>> {
|
||||
List<Object> psValues = new ArrayList<>();
|
||||
|
||||
for (Map.Entry<SQLField<E, ?>, Object> entry : modifiedValues.entrySet()) {
|
||||
sql += entry.getKey().getName() + " = ? ,";
|
||||
sql += "`" + entry.getKey().getName() + "` = ? ,";
|
||||
addValueToSQLObjectList(psValues, entry.getKey(), entry.getValue());
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ public class SQLField<E extends SQLElement<E>, T> {
|
||||
/* package */ Pair<String, List<Object>> forSQLPreparedStatement() {
|
||||
List<Object> params = new ArrayList<>(1);
|
||||
if (defaultValue != null && !autoIncrement) params.add(defaultValue);
|
||||
return new Pair<>(getName() + " " + type.toString() + (canBeNull ? " NULL" : " NOT NULL")
|
||||
return new Pair<>("`" + getName() + "` " + type.toString() + (canBeNull ? " NULL" : " NOT NULL")
|
||||
+ (autoIncrement ? " AUTO_INCREMENT" : "")
|
||||
+ ((defaultValue == null || autoIncrement) ? "" : " DEFAULT ?"), params);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user