Class SQLTemplates

Direct Known Subclasses:
CUBRIDTemplates, DB2Templates, DerbyTemplates, FirebirdTemplates, H2Templates, HSQLDBTemplates, MySQLTemplates, OracleTemplates, PostgreSQLTemplates, SQLiteTemplates, SQLServerTemplates, TeradataTemplates

public class SQLTemplates extends Templates
SQLTemplates extends Templates to provides SQL specific extensions and acts as database specific Dialect for Querydsl SQL
Author:
tiwe
  • Field Details

    • FOR_SHARE

      protected static final Expression<?> FOR_SHARE
    • FOR_UPDATE

      protected static final Expression<?> FOR_UPDATE
    • NO_WAIT

      protected static final Expression<?> NO_WAIT
    • TIME_WITH_TIMEZONE

      protected static final int TIME_WITH_TIMEZONE
      See Also:
    • TIMESTAMP_WITH_TIMEZONE

      protected static final int TIMESTAMP_WITH_TIMEZONE
      See Also:
    • RECURSIVE

      public static final Expression<?> RECURSIVE
    • DEFAULT

      public static final SQLTemplates DEFAULT
    • OTHER_LIKE_CASES

      protected static final Set<? extends Operator> OTHER_LIKE_CASES
  • Constructor Details

    • SQLTemplates

      @Deprecated protected SQLTemplates(String quoteStr, char escape, boolean useQuotes)
      Deprecated.
    • SQLTemplates

      protected SQLTemplates(Set<String> reservedKeywords, String quoteStr, char escape, boolean useQuotes)
    • SQLTemplates

      protected SQLTemplates(Set<String> reservedKeywords, String quoteStr, char escape, boolean useQuotes, boolean requiresSchemaInWhere)
  • Method Details

    • serialize

      public String serialize(String literal, int jdbcType)
    • escapeLiteral

      public String escapeLiteral(String str)
    • addTypeNameToCode

      protected void addTypeNameToCode(String type, int code, boolean override)
    • addTypeNameToCode

      protected void addTypeNameToCode(String type, int code)
    • addTableOverride

      protected void addTableOverride(SchemaAndTable from, SchemaAndTable to)
    • getCustomTypes

      public final List<Type<?>> getCustomTypes()
    • getAsc

      public final String getAsc()
    • getAutoIncrement

      public final String getAutoIncrement()
    • getColumnAlias

      public final String getColumnAlias()
    • getCount

      public final String getCount()
    • getCountStar

      public final String getCountStar()
    • getCrossJoin

      public final String getCrossJoin()
    • getDelete

      public final String getDelete()
    • getDesc

      public final String getDesc()
    • getDistinctCountEnd

      public final String getDistinctCountEnd()
    • getDistinctCountStart

      public final String getDistinctCountStart()
    • getDummyTable

      public final String getDummyTable()
    • getFrom

      public final String getFrom()
    • getFullJoin

      public final String getFullJoin()
    • getGroupBy

      public final String getGroupBy()
    • getHaving

      public final String getHaving()
    • getInnerJoin

      public final String getInnerJoin()
    • getInsertInto

      public final String getInsertInto()
    • getJoin

      public final String getJoin()
    • getJoinSymbol

      public final String getJoinSymbol(JoinType joinType)
    • getKey

      public final String getKey()
    • getLeftJoin

      public final String getLeftJoin()
    • getRightJoin

      public final String getRightJoin()
    • getLimitTemplate

      public final String getLimitTemplate()
    • getMergeInto

      public final String getMergeInto()
    • getNotNull

      public final String getNotNull()
    • getOffsetTemplate

      public final String getOffsetTemplate()
    • getOn

      public final String getOn()
    • getOrderBy

      public final String getOrderBy()
    • getSelect

      public final String getSelect()
    • getSelectDistinct

      public final String getSelectDistinct()
    • getSet

      public final String getSet()
    • getTableAlias

      public final String getTableAlias()
    • getTableOverrides

      public final Map<SchemaAndTable,SchemaAndTable> getTableOverrides()
    • getTypeNameForCode

      public String getTypeNameForCode(int code)
    • getCastTypeNameForCode

      public String getCastTypeNameForCode(int code)
    • getCodeForTypeName

      public Integer getCodeForTypeName(String type)
    • getUpdate

      public final String getUpdate()
    • getValues

      public final String getValues()
    • getDefaultValues

      public final String getDefaultValues()
    • getWhere

      public final String getWhere()
    • isNativeMerge

      public final boolean isNativeMerge()
    • isSupportsAlias

      public final boolean isSupportsAlias()
    • getCreateIndex

      public final String getCreateIndex()
    • getCreateUniqueIndex

      public final String getCreateUniqueIndex()
    • getCreateTable

      public final String getCreateTable()
    • getWith

      public final String getWith()
    • getWithRecursive

      public final String getWithRecursive()
    • isCountDistinctMultipleColumns

      public final boolean isCountDistinctMultipleColumns()
    • isRequiresSchemaInWhere

      public final boolean isRequiresSchemaInWhere()
    • isPrintSchema

      public final boolean isPrintSchema()
    • isParameterMetadataAvailable

      public final boolean isParameterMetadataAvailable()
    • isBatchCountViaGetUpdateCount

      public final boolean isBatchCountViaGetUpdateCount()
    • isUseQuotes

      public final boolean isUseQuotes()
    • isUnionsWrapped

      public final boolean isUnionsWrapped()
    • isForShareSupported

      public boolean isForShareSupported()
    • isFunctionJoinsWrapped

      public final boolean isFunctionJoinsWrapped()
    • isLimitRequired

      public final boolean isLimitRequired()
    • getNullsFirst

      public final String getNullsFirst()
    • getNullsLast

      public final String getNullsLast()
    • isCountViaAnalytics

      public final boolean isCountViaAnalytics()
    • isWrapSelectParameters

      public final boolean isWrapSelectParameters()
    • isArraysSupported

      public final boolean isArraysSupported()
    • getListMaxSize

      public final int getListMaxSize()
    • isSupportsUnquotedReservedWordsAsIdentifier

      public final boolean isSupportsUnquotedReservedWordsAsIdentifier()
    • isBatchToBulkSupported

      public final boolean isBatchToBulkSupported()
    • getForShareFlag

      public final QueryFlag getForShareFlag()
    • getForUpdateFlag

      public final QueryFlag getForUpdateFlag()
    • getNoWaitFlag

      public final QueryFlag getNoWaitFlag()
    • newLineToSingleSpace

      protected void newLineToSingleSpace()
    • quoteIdentifier

      public final String quoteIdentifier(String identifier)
    • quoteIdentifier

      public final String quoteIdentifier(String identifier, boolean precededByDot)
    • requiresQuotes

      protected boolean requiresQuotes(String identifier, boolean precededByDot)
    • serialize

      public void serialize(QueryMetadata metadata, boolean forCountRow, SQLSerializer context)
      template method for SELECT serialization
      Parameters:
      metadata -
      forCountRow -
      context -
    • serializeDelete

      public void serializeDelete(QueryMetadata metadata, RelationalPath<?> entity, SQLSerializer context)
      template method for DELETE serialization
      Parameters:
      metadata -
      entity -
      context -
    • serializeInsert

      public void serializeInsert(QueryMetadata metadata, RelationalPath<?> entity, List<Path<?>> columns, List<Expression<?>> values, SubQueryExpression<?> subQuery, SQLSerializer context)
      template method for INSERT serialization
      Parameters:
      metadata -
      entity -
      columns -
      values -
      subQuery -
      context -
    • serializeInsert

      public void serializeInsert(QueryMetadata metadata, RelationalPath<?> entity, List<SQLInsertBatch> batches, SQLSerializer context)
      template method for INSERT serialization
      Parameters:
      metadata -
      batches -
      context -
    • serializeMerge

      public void serializeMerge(QueryMetadata metadata, RelationalPath<?> entity, List<Path<?>> keys, List<Path<?>> columns, List<Expression<?>> values, SubQueryExpression<?> subQuery, SQLSerializer context)
      template method for MERGE serialization
      Parameters:
      metadata -
      entity -
      keys -
      columns -
      values -
      subQuery -
      context -
    • serializeUpdate

      public void serializeUpdate(QueryMetadata metadata, RelationalPath<?> entity, Map<Path<?>,Expression<?>> updates, SQLSerializer context)
      template method for UPDATE serialization
      Parameters:
      metadata -
      entity -
      updates -
      context -
    • serializeModifiers

      protected void serializeModifiers(QueryMetadata metadata, SQLSerializer context)
      template method for LIMIT and OFFSET serialization
      Parameters:
      metadata -
      context -
    • addCustomType

      protected void addCustomType(Type<?> type)
    • setAsc

      protected void setAsc(String asc)
    • setAutoIncrement

      protected void setAutoIncrement(String autoIncrement)
    • setColumnAlias

      protected void setColumnAlias(String columnAlias)
    • setCount

      protected void setCount(String count)
    • setCountStar

      protected void setCountStar(String countStar)
    • setCrossJoin

      protected void setCrossJoin(String crossJoin)
    • setDelete

      protected void setDelete(String delete)
    • setDesc

      protected void setDesc(String desc)
    • setDistinctCountEnd

      protected void setDistinctCountEnd(String distinctCountEnd)
    • setDistinctCountStart

      protected void setDistinctCountStart(String distinctCountStart)
    • setDummyTable

      protected void setDummyTable(String dummyTable)
    • setForShareSupported

      protected void setForShareSupported(boolean forShareSupported)
    • setFrom

      protected void setFrom(String from)
    • setFullJoin

      protected void setFullJoin(String fullJoin)
    • setGroupBy

      protected void setGroupBy(String groupBy)
    • setHaving

      protected void setHaving(String having)
    • setInnerJoin

      protected void setInnerJoin(String innerJoin)
    • setInsertInto

      protected void setInsertInto(String insertInto)
    • setJoin

      protected void setJoin(String join)
    • setKey

      protected void setKey(String key)
    • setLeftJoin

      protected void setLeftJoin(String leftJoin)
    • setRightJoin

      protected void setRightJoin(String rightJoin)
    • setMergeInto

      protected void setMergeInto(String mergeInto)
    • setNativeMerge

      protected void setNativeMerge(boolean nativeMerge)
    • setNotNull

      protected void setNotNull(String notNull)
    • setOffsetTemplate

      protected void setOffsetTemplate(String offsetTemplate)
    • setOn

      protected void setOn(String on)
    • setOrderBy

      protected void setOrderBy(String orderBy)
    • setSelect

      protected void setSelect(String select)
    • setSelectDistinct

      protected void setSelectDistinct(String selectDistinct)
    • setSet

      protected void setSet(String set)
    • setTableAlias

      protected void setTableAlias(String tableAlias)
    • setUpdate

      protected void setUpdate(String update)
    • setValues

      protected void setValues(String values)
    • setDefaultValues

      protected void setDefaultValues(String defaultValues)
    • setWhere

      protected void setWhere(String where)
    • setWith

      protected void setWith(String with)
    • setWithRecursive

      protected void setWithRecursive(String withRecursive)
    • setCreateIndex

      protected void setCreateIndex(String createIndex)
    • setCreateUniqueIndex

      protected void setCreateUniqueIndex(String createUniqueIndex)
    • setCreateTable

      protected void setCreateTable(String createTable)
    • setPrintSchema

      protected void setPrintSchema(boolean printSchema)
    • setParameterMetadataAvailable

      protected void setParameterMetadataAvailable(boolean parameterMetadataAvailable)
    • setBatchCountViaGetUpdateCount

      protected void setBatchCountViaGetUpdateCount(boolean batchCountViaGetUpdateCount)
    • setUnionsWrapped

      protected void setUnionsWrapped(boolean unionsWrapped)
    • setFunctionJoinsWrapped

      protected void setFunctionJoinsWrapped(boolean functionJoinsWrapped)
    • setNullsFirst

      protected void setNullsFirst(String nullsFirst)
    • setNullsLast

      protected void setNullsLast(String nullsLast)
    • setLimitRequired

      protected void setLimitRequired(boolean limitRequired)
    • setCountDistinctMultipleColumns

      protected void setCountDistinctMultipleColumns(boolean countDistinctMultipleColumns)
    • setCountViaAnalytics

      protected void setCountViaAnalytics(boolean countViaAnalytics)
    • setWrapSelectParameters

      protected void setWrapSelectParameters(boolean b)
    • setArraysSupported

      protected void setArraysSupported(boolean b)
    • setListMaxSize

      protected void setListMaxSize(int i)
    • setSupportsUnquotedReservedWordsAsIdentifier

      protected void setSupportsUnquotedReservedWordsAsIdentifier(boolean b)
    • setMaxLimit

      protected void setMaxLimit(int i)
    • setBatchToBulkSupported

      protected void setBatchToBulkSupported(boolean b)
    • setForShareFlag

      protected void setForShareFlag(QueryFlag flag)
    • setForUpdateFlag

      protected void setForUpdateFlag(QueryFlag flag)
    • setNoWaitFlag

      protected void setNoWaitFlag(QueryFlag flag)