com.jaregu.database.queries.compiling.PreparedQueryImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of queries Show documentation
Show all versions of queries Show documentation
Java based SQL templating project. Store your queries in *.sql files and build queries for execution. Supports simple expressions and conditional clauses and interface proxying for java-sql bridge.
package com.jaregu.database.queries.compiling;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import com.jaregu.database.queries.QueryId;
import com.jaregu.database.queries.building.ParametersResolver;
import com.jaregu.database.queries.building.Query;
import com.jaregu.database.queries.building.QueryImpl;
import com.jaregu.database.queries.compiling.PreparedQueryPart.Result;
import com.jaregu.database.queries.dialect.Dialect;
final class PreparedQueryImpl implements PreparedQuery {
final private QueryId id;
final private List parts;
final private Dialect dialect;
PreparedQueryImpl(QueryId id, List parts, Dialect dialect) {
this.id = id;
this.parts = parts;
this.dialect = dialect;
}
@Override
public QueryId getQueryId() {
return id;
}
@Override
public Query build(ParametersResolver resolver) {
StringBuilder sql = new StringBuilder();
List