public class SQLTemplates extends Templates
Modifier and Type | Class and Description |
---|---|
static class |
SQLTemplates.Builder |
Modifier and Type | Field and Description |
---|---|
static SQLTemplates |
DEFAULT |
static Expression<?> |
RECURSIVE |
protected static Set<String> |
SQL_RESERVED_WORDS |
Modifier | Constructor and Description |
---|---|
protected |
SQLTemplates(Set<String> reservedKeywords,
String quoteStr,
char escape,
boolean useQuotes) |
protected |
SQLTemplates(String quoteStr,
char escape,
boolean useQuotes)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addCustomType(Type<?> type) |
protected void |
addTableOverride(SchemaAndTable from,
SchemaAndTable to) |
protected void |
addTypeNameToCode(String type,
int code) |
protected void |
addTypeNameToCode(String type,
int code,
boolean override) |
String |
escapeLiteral(String str) |
String |
getAsc() |
String |
getAutoIncrement() |
String |
getCastTypeNameForCode(int code) |
Integer |
getCodeForTypeName(String type) |
String |
getColumnAlias() |
String |
getCount() |
String |
getCountStar() |
String |
getCreateIndex() |
String |
getCreateTable() |
String |
getCreateUniqueIndex() |
List<Type<?>> |
getCustomTypes() |
String |
getDefaultValues() |
String |
getDelete() |
String |
getDesc() |
String |
getDistinctCountEnd() |
String |
getDistinctCountStart() |
String |
getDummyTable() |
String |
getFrom() |
String |
getFullJoin() |
String |
getGroupBy() |
String |
getHaving() |
String |
getInnerJoin() |
String |
getInsertInto() |
String |
getJoin() |
String |
getJoinSymbol(JoinType joinType) |
String |
getKey() |
String |
getLeftJoin() |
String |
getLimitTemplate() |
int |
getListMaxSize() |
String |
getMergeInto() |
String |
getNotNull() |
String |
getNullsFirst() |
String |
getNullsLast() |
String |
getOffsetTemplate() |
String |
getOn() |
String |
getOrderBy() |
String |
getRightJoin() |
String |
getSelect() |
String |
getSelectDistinct() |
String |
getSet() |
String |
getTableAlias() |
Map<SchemaAndTable,SchemaAndTable> |
getTableOverrides() |
String |
getTypeForCast(Class<?> cl)
Deprecated.
|
String |
getTypeForClass(Class<?> cl)
Deprecated.
|
String |
getTypeNameForCode(int code) |
String |
getUpdate() |
String |
getValues() |
String |
getWhere() |
String |
getWith() |
String |
getWithRecursive() |
boolean |
isArraysSupported() |
boolean |
isBatchCountViaGetUpdateCount() |
boolean |
isBigDecimalSupported()
Deprecated.
|
boolean |
isCountDistinctMultipleColumns() |
boolean |
isCountViaAnalytics() |
boolean |
isFunctionJoinsWrapped() |
boolean |
isLimitRequired() |
boolean |
isNativeMerge() |
boolean |
isParameterMetadataAvailable() |
boolean |
isPrintSchema() |
boolean |
isSupportsAlias() |
boolean |
isSupportsUnquotedReservedWordsAsIdentifier() |
boolean |
isUnionsWrapped() |
boolean |
isUseQuotes() |
boolean |
isWrapSelectParameters() |
protected void |
newLineToSingleSpace() |
String |
quoteIdentifier(String identifier) |
String |
quoteIdentifier(String identifier,
boolean precededByDot) |
protected boolean |
requiresQuotes(String identifier,
boolean precededByDot) |
void |
serialize(QueryMetadata metadata,
boolean forCountRow,
SQLSerializer context)
template method for SELECT serialization
|
String |
serialize(String literal,
int jdbcType) |
void |
serializeDelete(QueryMetadata metadata,
RelationalPath<?> entity,
SQLSerializer context)
template method for DELETE serialization
|
void |
serializeInsert(QueryMetadata metadata,
RelationalPath<?> entity,
List<Path<?>> columns,
List<Expression<?>> values,
SubQueryExpression<?> subQuery,
SQLSerializer context)
template method for INSERT serialization
|
void |
serializeMerge(QueryMetadata metadata,
RelationalPath<?> entity,
List<Path<?>> keys,
List<Path<?>> columns,
List<Expression<?>> values,
SubQueryExpression<?> subQuery,
SQLSerializer context)
template method for MERGE serialization
|
protected void |
serializeModifiers(QueryMetadata metadata,
SQLSerializer context)
template method for LIMIT and OFFSET serialization
|
void |
serializeUpdate(QueryMetadata metadata,
RelationalPath<?> entity,
List<com.mysema.commons.lang.Pair<Path<?>,Expression<?>>> updates,
SQLSerializer context)
template method for UPDATE serialization
|
protected void |
setArraysSupported(boolean b) |
protected void |
setAsc(String asc) |
protected void |
setAutoIncrement(String autoIncrement) |
protected void |
setBatchCountViaGetUpdateCount(boolean batchCountViaGetUpdateCount) |
protected void |
setColumnAlias(String columnAlias) |
protected void |
setCount(String count) |
protected void |
setCountDistinctMultipleColumns(boolean countDistinctMultipleColumns) |
protected void |
setCountStar(String countStar) |
protected void |
setCountViaAnalytics(boolean countViaAnalytics) |
protected void |
setCreateIndex(String createIndex) |
protected void |
setCreateTable(String createTable) |
protected void |
setCreateUniqueIndex(String createUniqueIndex) |
protected void |
setDefaultValues(String defaultValues) |
protected void |
setDelete(String delete) |
protected void |
setDesc(String desc) |
protected void |
setDistinctCountEnd(String distinctCountEnd) |
protected void |
setDistinctCountStart(String distinctCountStart) |
protected void |
setDummyTable(String dummyTable) |
protected void |
setFrom(String from) |
protected void |
setFullJoin(String fullJoin) |
protected void |
setFunctionJoinsWrapped(boolean functionJoinsWrapped) |
protected void |
setGroupBy(String groupBy) |
protected void |
setHaving(String having) |
protected void |
setInnerJoin(String innerJoin) |
protected void |
setInsertInto(String insertInto) |
protected void |
setJoin(String join) |
protected void |
setKey(String key) |
protected void |
setLeftJoin(String leftJoin) |
protected void |
setLimitRequired(boolean limitRequired) |
protected void |
setListMaxSize(int i) |
protected void |
setMergeInto(String mergeInto) |
protected void |
setNativeMerge(boolean nativeMerge) |
protected void |
setNotNull(String notNull) |
protected void |
setNullsFirst(String nullsFirst) |
protected void |
setNullsLast(String nullsLast) |
protected void |
setOffsetTemplate(String offsetTemplate) |
protected void |
setOn(String on) |
protected void |
setOrderBy(String orderBy) |
protected void |
setParameterMetadataAvailable(boolean parameterMetadataAvailable) |
protected void |
setPrintSchema(boolean printSchema) |
protected void |
setRightJoin(String rightJoin) |
protected void |
setSelect(String select) |
protected void |
setSelectDistinct(String selectDistinct) |
protected void |
setSet(String set) |
void |
setSupportsUnquotedReservedWordsAsIdentifier(boolean b) |
protected void |
setTableAlias(String tableAlias) |
protected void |
setUnionsWrapped(boolean unionsWrapped) |
protected void |
setUpdate(String update) |
protected void |
setValues(String values) |
protected void |
setWhere(String where) |
protected void |
setWith(String with) |
protected void |
setWithRecursive(String withRecursive) |
protected void |
setWrapSelectParameters(boolean b) |
add, add, add, escapeForLike, getEscapeChar, getPrecedence, getTemplate
public static final Expression<?> RECURSIVE
public static final SQLTemplates DEFAULT
@Deprecated protected SQLTemplates(String quoteStr, char escape, boolean useQuotes)
protected void addTypeNameToCode(String type, int code, boolean override)
protected void addTypeNameToCode(String type, int code)
protected void addTableOverride(SchemaAndTable from, SchemaAndTable to)
@Deprecated public final boolean isBigDecimalSupported()
public final String getAsc()
public final String getAutoIncrement()
public final String getColumnAlias()
public final String getCount()
public final String getCountStar()
public final String getDelete()
public final String getDesc()
public final String getDistinctCountEnd()
public final String getDistinctCountStart()
public final String getDummyTable()
public final String getFrom()
public final String getFullJoin()
public final String getGroupBy()
public final String getHaving()
public final String getInnerJoin()
public final String getInsertInto()
public final String getJoin()
public final String getKey()
public final String getLeftJoin()
public final String getRightJoin()
public final String getLimitTemplate()
public final String getMergeInto()
public final String getNotNull()
public final String getOffsetTemplate()
public final String getOn()
public final String getOrderBy()
public final String getSelect()
public final String getSelectDistinct()
public final String getSet()
public final String getTableAlias()
public final Map<SchemaAndTable,SchemaAndTable> getTableOverrides()
@Deprecated public String getTypeForCast(Class<?> cl)
@Deprecated public String getTypeForClass(Class<?> cl)
public String getTypeNameForCode(int code)
public String getCastTypeNameForCode(int code)
public final String getUpdate()
public final String getValues()
public final String getDefaultValues()
public final String getWhere()
public final boolean isNativeMerge()
public final boolean isSupportsAlias()
public final String getCreateIndex()
public final String getCreateUniqueIndex()
public final String getCreateTable()
public final String getWith()
public final String getWithRecursive()
public final boolean isCountDistinctMultipleColumns()
public final boolean isPrintSchema()
public final boolean isParameterMetadataAvailable()
public final boolean isBatchCountViaGetUpdateCount()
public final boolean isUseQuotes()
public final boolean isUnionsWrapped()
public final boolean isFunctionJoinsWrapped()
public final boolean isLimitRequired()
public final String getNullsFirst()
public final String getNullsLast()
public boolean isCountViaAnalytics()
public boolean isWrapSelectParameters()
public boolean isArraysSupported()
public int getListMaxSize()
public boolean isSupportsUnquotedReservedWordsAsIdentifier()
protected void newLineToSingleSpace()
protected boolean requiresQuotes(String identifier, boolean precededByDot)
public void serialize(QueryMetadata metadata, boolean forCountRow, SQLSerializer context)
metadata
- forCountRow
- context
- public void serializeDelete(QueryMetadata metadata, RelationalPath<?> entity, SQLSerializer context)
metadata
- entity
- context
- public void serializeInsert(QueryMetadata metadata, RelationalPath<?> entity, List<Path<?>> columns, List<Expression<?>> values, SubQueryExpression<?> subQuery, SQLSerializer context)
metadata
- entity
- columns
- values
- subQuery
- context
- public void serializeMerge(QueryMetadata metadata, RelationalPath<?> entity, List<Path<?>> keys, List<Path<?>> columns, List<Expression<?>> values, SubQueryExpression<?> subQuery, SQLSerializer context)
metadata
- entity
- keys
- columns
- values
- subQuery
- context
- public void serializeUpdate(QueryMetadata metadata, RelationalPath<?> entity, List<com.mysema.commons.lang.Pair<Path<?>,Expression<?>>> updates, SQLSerializer context)
metadata
- entity
- updates
- context
- protected void serializeModifiers(QueryMetadata metadata, SQLSerializer context)
metadata
- context
- protected void addCustomType(Type<?> type)
protected void setAsc(String asc)
protected void setAutoIncrement(String autoIncrement)
protected void setColumnAlias(String columnAlias)
protected void setCount(String count)
protected void setCountStar(String countStar)
protected void setDelete(String delete)
protected void setDesc(String desc)
protected void setDistinctCountEnd(String distinctCountEnd)
protected void setDistinctCountStart(String distinctCountStart)
protected void setDummyTable(String dummyTable)
protected void setFrom(String from)
protected void setFullJoin(String fullJoin)
protected void setGroupBy(String groupBy)
protected void setHaving(String having)
protected void setInnerJoin(String innerJoin)
protected void setInsertInto(String insertInto)
protected void setJoin(String join)
protected void setKey(String key)
protected void setLeftJoin(String leftJoin)
protected void setRightJoin(String rightJoin)
protected void setMergeInto(String mergeInto)
protected void setNativeMerge(boolean nativeMerge)
protected void setNotNull(String notNull)
protected void setOffsetTemplate(String offsetTemplate)
protected void setOn(String on)
protected void setOrderBy(String orderBy)
protected void setSelect(String select)
protected void setSelectDistinct(String selectDistinct)
protected void setSet(String set)
protected void setTableAlias(String tableAlias)
protected void setUpdate(String update)
protected void setValues(String values)
protected void setDefaultValues(String defaultValues)
protected void setWhere(String where)
protected void setWith(String with)
protected void setWithRecursive(String withRecursive)
protected void setCreateIndex(String createIndex)
protected void setCreateUniqueIndex(String createUniqueIndex)
protected void setCreateTable(String createTable)
protected void setPrintSchema(boolean printSchema)
protected void setParameterMetadataAvailable(boolean parameterMetadataAvailable)
protected void setBatchCountViaGetUpdateCount(boolean batchCountViaGetUpdateCount)
protected void setUnionsWrapped(boolean unionsWrapped)
protected void setFunctionJoinsWrapped(boolean functionJoinsWrapped)
protected void setNullsFirst(String nullsFirst)
protected void setNullsLast(String nullsLast)
protected void setLimitRequired(boolean limitRequired)
protected void setCountDistinctMultipleColumns(boolean countDistinctMultipleColumns)
protected void setCountViaAnalytics(boolean countViaAnalytics)
protected void setWrapSelectParameters(boolean b)
protected void setArraysSupported(boolean b)
protected void setListMaxSize(int i)
public void setSupportsUnquotedReservedWordsAsIdentifier(boolean b)
Copyright © 2007–2015 Mysema Ltd. All rights reserved.