Class MyBatis3FormattingUtilities

java.lang.Object
org.mybatis.generator.codegen.mybatis3.MyBatis3FormattingUtilities

public class MyBatis3FormattingUtilities extends Object
  • Method Details

    • getParameterClause

      public static String getParameterClause(IntrospectedColumn introspectedColumn)
    • getParameterClause

      public static String getParameterClause(IntrospectedColumn introspectedColumn, String prefix)
    • getSelectListPhrase

      public static String getSelectListPhrase(IntrospectedColumn introspectedColumn)
      The phrase to use in a select list. If there is a table alias, the value will be "alias.columnName as alias_columnName"
      Parameters:
      introspectedColumn - the introspected column
      Returns:
      the proper phrase
    • getEscapedColumnName

      public static String getEscapedColumnName(IntrospectedColumn introspectedColumn)
    • getAliasedEscapedColumnName

      public static String getAliasedEscapedColumnName(IntrospectedColumn introspectedColumn)
    • getAliasedActualColumnName

      public static String getAliasedActualColumnName(IntrospectedColumn introspectedColumn)
      The aliased column name for a select statement generated by the example clauses. This is not appropriate for selects in SqlMaps because the column is not escaped for MyBatis. If there is a table alias, the value will be alias.columnName.

      This method is used in the Example classes and the returned value will be in a Java string. So we need to escape double quotes if they are the delimiters.

      Parameters:
      introspectedColumn - the introspected column
      Returns:
      the aliased column name
    • getRenamedColumnNameForResultMap

      public static String getRenamedColumnNameForResultMap(IntrospectedColumn introspectedColumn)
      The renamed column name for a select statement. If there is a table alias, the value will be alias_columnName. This is appropriate for use in a result map.
      Parameters:
      introspectedColumn - the introspected column
      Returns:
      the renamed column name