Class MySqlTranslator
- java.lang.Object
-
- com.feedzai.commons.sql.abstraction.engine.AbstractTranslator
-
- com.feedzai.commons.sql.abstraction.engine.impl.MySqlTranslator
-
public class MySqlTranslator extends AbstractTranslator
Provides SQL translation for MySQL.- Since:
- 2.0.0
- Author:
- Rui Vilao (rui.vilao@feedzai.com)
-
-
Field Summary
-
Fields inherited from class com.feedzai.commons.sql.abstraction.engine.AbstractTranslator
injector, properties
-
-
Constructor Summary
Constructors Constructor Description MySqlTranslator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected UnionrowsToUnion(List<Expression> rows)Transform values' rows into a union.Stringtranslate(AlterColumn ac)TranslatesName.Stringtranslate(DbColumn c)TranslatesDbColumn.Stringtranslate(DropPrimaryKey dpk)TranslatesDropPrimaryKey.Stringtranslate(Rename r)TranslatesRename.Stringtranslate(Cast cast)Translates Cast.Stringtranslate(Function f)TranslatesFunction.Stringtranslate(Modulo m)TranslatesModulo.Stringtranslate(Query q)TranslatesQuery.Stringtranslate(RepeatDelimiter rd)TranslatesRepeatDelimiter.Stringtranslate(StringAgg stringAgg)TranslatesStringAgg.Stringtranslate(View v)TranslatesView.Stringtranslate(With with)StringtranslateEscape()Translates the escape character.StringtranslateFalse()Translates the boolean false.StringtranslateTrue()Translates the boolean true.protected StringtranslateUpdateFrom(Update update)TranslatesUpdateconsidering the FROM clause.-
Methods inherited from class com.feedzai.commons.sql.abstraction.engine.AbstractTranslator
inject, inject, join, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translateUpdate, translateUpdateSetClause
-
-
-
-
Method Detail
-
translate
public String translate(AlterColumn ac)
Description copied from class:AbstractTranslatorTranslatesName.- Specified by:
translatein classAbstractTranslator- Parameters:
ac- The object to translate.- Returns:
- The string representation of the given object.
-
translate
public String translate(DropPrimaryKey dpk)
Description copied from class:AbstractTranslatorTranslatesDropPrimaryKey.- Specified by:
translatein classAbstractTranslator- Parameters:
dpk- The object to translate.- Returns:
- The string representation of the given object.
-
translate
public String translate(Function f)
Description copied from class:AbstractTranslatorTranslatesFunction.- Specified by:
translatein classAbstractTranslator- Parameters:
f- The object to translate.- Returns:
- The string representation of the given object.
-
translate
public String translate(Modulo m)
Description copied from class:AbstractTranslatorTranslatesModulo.- Specified by:
translatein classAbstractTranslator- Parameters:
m- The object to translate.- Returns:
- The string representation of the given object.
-
translate
public String translate(Rename r)
Description copied from class:AbstractTranslatorTranslatesRename.- Specified by:
translatein classAbstractTranslator- Parameters:
r- The object to translate.- Returns:
- The string representation of the given object.
-
translate
public String translate(RepeatDelimiter rd)
Description copied from class:AbstractTranslatorTranslatesRepeatDelimiter.- Specified by:
translatein classAbstractTranslator- Parameters:
rd- The object to translate.- Returns:
- The string representation of the given object.
-
translate
public String translate(Query q)
Description copied from class:AbstractTranslatorTranslatesQuery.- Specified by:
translatein classAbstractTranslator- Parameters:
q- The object to translate.- Returns:
- The string representation of the given object.
-
translateUpdateFrom
protected String translateUpdateFrom(Update update)
Description copied from class:AbstractTranslatorTranslatesUpdateconsidering the FROM clause.- Overrides:
translateUpdateFromin classAbstractTranslator- Parameters:
update- The update to translate.- Returns:
- The string representation of the given object.
-
translate
public String translate(View v)
Description copied from class:AbstractTranslatorTranslatesView.- Specified by:
translatein classAbstractTranslator- Parameters:
v- The object to translate.- Returns:
- The string representation of the given object.
-
translate
public String translate(DbColumn c)
Description copied from class:AbstractTranslatorTranslatesDbColumn.- Specified by:
translatein classAbstractTranslator- Parameters:
c- The object to translate.- Returns:
- The string representation of the given object.
-
translate
public String translate(Cast cast)
Description copied from class:AbstractTranslatorTranslates Cast.- Specified by:
translatein classAbstractTranslator- Parameters:
cast- a cast expression.- Returns:
- cast translation.
-
translate
public String translate(With with)
- Overrides:
translatein classAbstractTranslator
-
rowsToUnion
protected Union rowsToUnion(List<Expression> rows)
Description copied from class:AbstractTranslatorTransform values' rows into a union.- Overrides:
rowsToUnionin classAbstractTranslator- Parameters:
rows- the values' rows- Returns:
- the resulting union
-
translate
public String translate(StringAgg stringAgg)
Description copied from class:AbstractTranslatorTranslatesStringAgg.- Specified by:
translatein classAbstractTranslator- Parameters:
stringAgg- The object to translate.- Returns:
- The string representation of the given object.
-
translateEscape
public String translateEscape()
Description copied from class:AbstractTranslatorTranslates the escape character.- Specified by:
translateEscapein classAbstractTranslator- Returns:
- The string representation of the escape character.
-
translateTrue
public String translateTrue()
Description copied from class:AbstractTranslatorTranslates the boolean true.- Specified by:
translateTruein classAbstractTranslator- Returns:
- The string representation of the true keyword.
-
translateFalse
public String translateFalse()
Description copied from class:AbstractTranslatorTranslates the boolean false.- Specified by:
translateFalsein classAbstractTranslator- Returns:
- The string representation of the false keyword.
-
-