org.mybatis.generator.codegen.mybatis3
Class MyBatis3FormattingUtilities

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

public class MyBatis3FormattingUtilities
extends Object

Author:
Jeff Butler

Method Summary
static String escapeStringForMyBatis3(String s)
           
static String getAliasedActualColumnName(IntrospectedColumn introspectedColumn)
          The aliased column name for a select statement generated by the example clauses.
static String getAliasedEscapedColumnName(IntrospectedColumn introspectedColumn)
          Calculates the string to use in select phrases in SqlMaps.
static String getEscapedColumnName(IntrospectedColumn introspectedColumn)
           
static String getParameterClause(IntrospectedColumn introspectedColumn)
           
static String getParameterClause(IntrospectedColumn introspectedColumn, String prefix)
           
static String getRenamedColumnNameForResultMap(IntrospectedColumn introspectedColumn)
          The renamed column name for a select statement.
static String getSelectListPhrase(IntrospectedColumn introspectedColumn)
          The phrase to use in a select list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

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"

Returns:
the proper phrase

getEscapedColumnName

public static String getEscapedColumnName(IntrospectedColumn introspectedColumn)

getAliasedEscapedColumnName

public static String getAliasedEscapedColumnName(IntrospectedColumn introspectedColumn)
Calculates the string to use in select phrases in SqlMaps.

Returns:
the aliased escaped column name

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.

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.

Returns:
the renamed column name

escapeStringForMyBatis3

public static String escapeStringForMyBatis3(String s)


Copyright © 2010-2012 MyBatis.org. All Rights Reserved.