List<String> fields = new ArrayList<String>();
DatabaseFieldStrategy<T> strat = new DatabaseFieldStrategy<>();
for (Field f : this.name.getDeclaredFields()) {
DatabaseField db = f.getAnnotation(DatabaseField.class);
if (strat.isNotKey(db)) {
String fieldName = db.name();
fields.add(fieldName);
}
}
String fieldsWithCommas = StringUtils.join(fields.toArray(), ",");
String questionMarks = "";
int i = 0;
for (Field f : this.name.getDeclaredFields()) {
if (i != 0) {
questionMarks += ",";
}
DatabaseField db = f.getAnnotation(DatabaseField.class);
if (strat.isNotKey(db)) {
if (strat.hasDefault(db)) {
questionMarks += db.defaultValue();
} else {
questionMarks += "?";
}
i++;