public class SQLSerializer extends SerializerBase<SQLSerializer>
SqlSerializer
serializes SQL clauses into SQLModifier and Type | Class and Description |
---|---|
protected static class |
SQLSerializer.Stage |
Modifier and Type | Field and Description |
---|---|
protected static String |
COMMA |
protected Configuration |
configuration |
protected LinkedList<Path<?>> |
constantPaths |
protected List<Object> |
constants |
protected boolean |
dml |
protected boolean |
dmlWithSchema |
protected RelationalPath<?> |
entity |
protected boolean |
inJoin |
protected boolean |
inSubquery |
protected boolean |
inUnion |
protected static Expression<?> |
Q |
protected boolean |
skipParent |
protected SQLSerializer.Stage |
stage |
protected SQLTemplates |
templates |
protected boolean |
useLiterals |
protected Set<Path<?>> |
withAliases |
Constructor and Description |
---|
SQLSerializer(Configuration conf) |
SQLSerializer(Configuration conf,
boolean dml) |
Modifier and Type | Method and Description |
---|---|
protected void |
appendAsColumnName(Path<?> path,
boolean precededByDot) |
protected void |
appendSchemaName(String schema) |
protected void |
appendTableName(String table,
boolean precededByDot) |
List<Path<?>> |
getConstantPaths() |
List<Object> |
getConstants() |
protected List<Expression<?>> |
getIdentifierColumns(List<JoinExpression> joins,
boolean alias)
Return a list of expressions that can be used to uniquely define the query sources
|
protected SchemaAndTable |
getSchemaAndTable(RelationalPath<?> path) |
protected SQLTemplates |
getTemplates() |
void |
handle(String template,
Object... args) |
protected void |
handleJoinTarget(JoinExpression je) |
protected void |
handleOrderBy(List<OrderSpecifier<?>> orderBy) |
SQLSerializer |
handleSelect(String sep,
List<? extends Expression<?>> expressions) |
void |
serialize(QueryMetadata metadata,
boolean forCountRow) |
void |
serializeDelete(QueryMetadata metadata,
RelationalPath<?> entity) |
protected void |
serializeForDelete(QueryMetadata metadata,
RelationalPath<?> entity) |
protected void |
serializeForInsert(QueryMetadata metadata,
RelationalPath<?> entity,
List<Path<?>> columns,
List<Expression<?>> values,
SubQueryExpression<?> subQuery) |
protected void |
serializeForInsert(QueryMetadata metadata,
RelationalPath<?> entity,
List<SQLInsertBatch> batches) |
protected void |
serializeForMerge(QueryMetadata metadata,
RelationalPath<?> entity,
List<Path<?>> keys,
List<Path<?>> columns,
List<Expression<?>> values,
SubQueryExpression<?> subQuery) |
protected void |
serializeForQuery(QueryMetadata metadata,
boolean forCountRow) |
protected void |
serializeForUpdate(QueryMetadata metadata,
RelationalPath<?> entity,
Map<Path<?>,Expression<?>> updates) |
protected void |
serializeForWhere(QueryMetadata metadata) |
void |
serializeInsert(QueryMetadata metadata,
RelationalPath<?> entity,
List<Path<?>> columns,
List<Expression<?>> values,
SubQueryExpression<?> subQuery) |
void |
serializeInsert(QueryMetadata metadata,
RelationalPath<?> entity,
List<SQLInsertBatch> batches) |
void |
serializeMerge(QueryMetadata metadata,
RelationalPath<?> entity,
List<Path<?>> keys,
List<Path<?>> columns,
List<Expression<?>> values,
SubQueryExpression<?> subQuery) |
protected void |
serializeSources(List<JoinExpression> joins) |
void |
serializeUnion(Expression<?> union,
QueryMetadata metadata,
boolean unionAll) |
void |
serializeUpdate(QueryMetadata metadata,
RelationalPath<?> entity,
Map<Path<?>,Expression<?>> updates) |
protected void |
setDmlWithSchema(boolean b) |
protected void |
setSkipParent(boolean b) |
void |
setUseLiterals(boolean useLiterals) |
Void |
visit(ParamExpression<?> param,
Void context)
Visit a ParamExpression instance with the given context
|
Void |
visit(Path<?> path,
Void context)
Visit a Path instance with the given context
|
Void |
visit(SubQueryExpression<?> query,
Void context)
Visit a SubQueryExpression instance with the given context
|
Void |
visit(TemplateExpression<?> expr,
Void context)
Visit a TemplateExpression instance with the given context
|
void |
visitConstant(Object constant) |
protected void |
visitOperation(Class<?> type,
Operator operator,
List<? extends Expression<?>> args) |
append, getConstantPrefix, getConstantToLabel, getLength, getTemplate, handle, handle, handle, handle, handle, handleTemplate, insert, prepend, serialize, serialize, setAnonParamPrefix, setConstantPrefix, setNormalize, setParamPrefix, setStrict, toString, visit, visit, visit
protected static final Expression<?> Q
protected static final String COMMA
protected final LinkedList<Path<?>> constantPaths
protected final boolean dml
protected SQLSerializer.Stage stage
protected boolean skipParent
protected boolean dmlWithSchema
protected RelationalPath<?> entity
protected final Configuration configuration
protected final SQLTemplates templates
protected boolean inUnion
protected boolean inJoin
protected boolean inSubquery
protected boolean useLiterals
public SQLSerializer(Configuration conf)
public SQLSerializer(Configuration conf, boolean dml)
protected void appendAsColumnName(Path<?> path, boolean precededByDot)
protected SchemaAndTable getSchemaAndTable(RelationalPath<?> path)
protected void appendSchemaName(String schema)
protected void appendTableName(String table, boolean precededByDot)
protected List<Expression<?>> getIdentifierColumns(List<JoinExpression> joins, boolean alias)
joins
- protected SQLTemplates getTemplates()
public final SQLSerializer handleSelect(String sep, List<? extends Expression<?>> expressions)
protected void handleJoinTarget(JoinExpression je)
public void serialize(QueryMetadata metadata, boolean forCountRow)
protected void serializeForQuery(QueryMetadata metadata, boolean forCountRow)
protected void handleOrderBy(List<OrderSpecifier<?>> orderBy)
public void serializeDelete(QueryMetadata metadata, RelationalPath<?> entity)
protected void serializeForDelete(QueryMetadata metadata, RelationalPath<?> entity)
protected void serializeForWhere(QueryMetadata metadata)
public void serializeMerge(QueryMetadata metadata, RelationalPath<?> entity, List<Path<?>> keys, List<Path<?>> columns, List<Expression<?>> values, @Nullable SubQueryExpression<?> subQuery)
protected void serializeForMerge(QueryMetadata metadata, RelationalPath<?> entity, List<Path<?>> keys, List<Path<?>> columns, List<Expression<?>> values, @Nullable SubQueryExpression<?> subQuery)
public void serializeInsert(QueryMetadata metadata, RelationalPath<?> entity, List<Path<?>> columns, List<Expression<?>> values, @Nullable SubQueryExpression<?> subQuery)
public void serializeInsert(QueryMetadata metadata, RelationalPath<?> entity, List<SQLInsertBatch> batches)
protected void serializeForInsert(QueryMetadata metadata, RelationalPath<?> entity, List<SQLInsertBatch> batches)
protected void serializeForInsert(QueryMetadata metadata, RelationalPath<?> entity, List<Path<?>> columns, List<Expression<?>> values, @Nullable SubQueryExpression<?> subQuery)
public void serializeUpdate(QueryMetadata metadata, RelationalPath<?> entity, Map<Path<?>,Expression<?>> updates)
protected void serializeForUpdate(QueryMetadata metadata, RelationalPath<?> entity, Map<Path<?>,Expression<?>> updates)
protected void serializeSources(List<JoinExpression> joins)
public void serializeUnion(Expression<?> union, QueryMetadata metadata, boolean unionAll)
public void visitConstant(Object constant)
visitConstant
in class SerializerBase<SQLSerializer>
public Void visit(ParamExpression<?> param, Void context)
Visitor
visit
in interface Visitor<Void,Void>
visit
in class SerializerBase<SQLSerializer>
param
- expression to visitcontext
- context of the visit or null, if not usedpublic Void visit(Path<?> path, Void context)
Visitor
visit
in interface Visitor<Void,Void>
visit
in class SerializerBase<SQLSerializer>
path
- expression to visitcontext
- context of the visit or null, if not usedpublic Void visit(SubQueryExpression<?> query, Void context)
Visitor
query
- expression to visitcontext
- context of the visit or null, if not usedpublic Void visit(TemplateExpression<?> expr, Void context)
Visitor
visit
in interface Visitor<Void,Void>
visit
in class SerializerBase<SQLSerializer>
expr
- expression to visitcontext
- context of the visit or null, if not usedprotected void visitOperation(Class<?> type, Operator operator, List<? extends Expression<?>> args)
visitOperation
in class SerializerBase<SQLSerializer>
public void setUseLiterals(boolean useLiterals)
protected void setSkipParent(boolean b)
protected void setDmlWithSchema(boolean b)
Copyright © 2007–2018 Querydsl. All rights reserved.