public class

Ibatis2FormattingUtilities

extends Object
java.lang.Object
   ↳ org.mybatis.generator.codegen.ibatis2.Ibatis2FormattingUtilities

Summary

Public Methods
static String escapeStringForIbatis2(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.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static String escapeStringForIbatis2 (String s)

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 iBATIS. 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

public static String getAliasedEscapedColumnName (IntrospectedColumn introspectedColumn)

Calculates the string to use in select phrases in SqlMaps.

Returns
  • the aliased escaped column name

public static String getEscapedColumnName (IntrospectedColumn introspectedColumn)

public static String getParameterClause (IntrospectedColumn introspectedColumn)

public static String getParameterClause (IntrospectedColumn introspectedColumn, String prefix)

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

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