sorted methods alphabetically
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -137,30 +137,6 @@ public class Database {
|
||||
if (!sortFields.isEmpty()) sql.append(" ORDER BY ").append(String.join(", ",sortFields));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Request clone() {
|
||||
Request clone = new Request(new StringBuilder(sql));
|
||||
clone.where.putAll(where);
|
||||
clone.values.putAll(values);
|
||||
return clone;
|
||||
}
|
||||
|
||||
/**
|
||||
* finalize sql, save sql and arguments as compiled request
|
||||
* @return
|
||||
*/
|
||||
public CompiledRequest compile(Object ...additionalArgs){
|
||||
var args = new ArrayList<>();
|
||||
applyValues(args);
|
||||
applyConditions(args);
|
||||
applyGrouping();
|
||||
applySorting();
|
||||
if (additionalArgs != null) {
|
||||
for (Object arg : additionalArgs) args.add(arg);
|
||||
}
|
||||
return new CompiledRequest(sql.toString(),args);
|
||||
}
|
||||
|
||||
/**
|
||||
* apply values (for insert or update statements)
|
||||
* @param args
|
||||
@@ -193,6 +169,30 @@ public class Database {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Request clone() {
|
||||
Request clone = new Request(new StringBuilder(sql));
|
||||
clone.where.putAll(where);
|
||||
clone.values.putAll(values);
|
||||
return clone;
|
||||
}
|
||||
|
||||
/**
|
||||
* finalize sql, save sql and arguments as compiled request
|
||||
* @return
|
||||
*/
|
||||
public CompiledRequest compile(Object ...additionalArgs){
|
||||
var args = new ArrayList<>();
|
||||
applyValues(args);
|
||||
applyConditions(args);
|
||||
applyGrouping();
|
||||
applySorting();
|
||||
if (additionalArgs != null) {
|
||||
for (Object arg : additionalArgs) args.add(arg);
|
||||
}
|
||||
return new CompiledRequest(sql.toString(),args);
|
||||
}
|
||||
|
||||
public Request groupBy(String column) {
|
||||
groupBy = column;
|
||||
return this;
|
||||
|
||||
Reference in New Issue
Block a user