org.apache.ibatis.ibator.api
Class IntrospectedColumn

java.lang.Object
  extended by org.apache.ibatis.ibator.api.IntrospectedColumn

public class IntrospectedColumn
extends java.lang.Object

This class holds information about an introspected column. The class has utility methods useful for generating iBATIS objects.

Author:
Jeff Butler

Field Summary
protected  java.lang.String actualColumnName
           
protected  FullyQualifiedJavaType fullyQualifiedJavaType
           
protected  IbatorContext ibatorContext
           
protected  boolean identity
           
protected  IntrospectedTable introspectedTable
           
protected  boolean isColumnNameDelimited
           
protected  java.lang.String javaProperty
           
protected  int jdbcType
           
protected  java.lang.String jdbcTypeName
           
protected  int length
           
protected  boolean nullable
           
protected  int scale
           
protected  java.lang.String tableAlias
           
protected  java.lang.String typeHandler
           
 
Constructor Summary
IntrospectedColumn()
          Constructs a Column definition.
 
Method Summary
 java.lang.String getActualColumnName()
           
 java.lang.String getAliasedActualColumnName()
          The aliased column name for a select statement generated by the example clauses.
 java.lang.String getAliasedEscapedColumnName()
          Calculates the string to use in select phrases in SqlMaps.
 java.lang.String getEscapedColumnName()
           
 FullyQualifiedJavaType getFullyQualifiedJavaType()
           
 java.lang.String getIbatisFormattedParameterClause()
           
 java.lang.String getIbatisFormattedParameterClause(java.lang.String prefix)
           
 IbatorContext getIbatorContext()
           
 IntrospectedTable getIntrospectedTable()
           
 java.lang.String getJavaProperty()
           
 java.lang.String getJavaProperty(java.lang.String prefix)
           
 int getJdbcType()
           
 java.lang.String getJdbcTypeName()
           
 int getLength()
           
 java.lang.String getRenamedColumnNameForResultMap()
          The renamed column name for a select statement.
 int getScale()
           
 java.lang.String getSelectListPhrase()
          The phrase to use in a select list.
 java.lang.String getTableAlias()
           
 java.lang.String getTypeHandler()
           
 boolean isBLOBColumn()
           
 boolean isColumnNameDelimited()
           
 boolean isIdentity()
           
 boolean isJdbcCharacterColumn()
           
 boolean isJDBCDateColumn()
           
 boolean isJDBCTimeColumn()
           
 boolean isNullable()
           
 boolean isStringColumn()
           
 void setActualColumnName(java.lang.String actualColumnName)
           
 void setColumnNameDelimited(boolean isColumnNameDelimited)
           
 void setFullyQualifiedJavaType(FullyQualifiedJavaType fullyQualifiedJavaType)
           
 void setIbatorContext(IbatorContext ibatorContext)
           
 void setIdentity(boolean identity)
           
 void setIntrospectedTable(IntrospectedTable introspectedTable)
           
 void setJavaProperty(java.lang.String javaProperty)
           
 void setJdbcType(int jdbcType)
           
 void setJdbcTypeName(java.lang.String jdbcTypeName)
           
 void setLength(int length)
           
 void setNullable(boolean nullable)
           
 void setScale(int scale)
           
 void setTableAlias(java.lang.String tableAlias)
           
 void setTypeHandler(java.lang.String typeHandler)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

actualColumnName

protected java.lang.String actualColumnName

jdbcType

protected int jdbcType

jdbcTypeName

protected java.lang.String jdbcTypeName

nullable

protected boolean nullable

length

protected int length

scale

protected int scale

identity

protected boolean identity

javaProperty

protected java.lang.String javaProperty

fullyQualifiedJavaType

protected FullyQualifiedJavaType fullyQualifiedJavaType

tableAlias

protected java.lang.String tableAlias

typeHandler

protected java.lang.String typeHandler

ibatorContext

protected IbatorContext ibatorContext

isColumnNameDelimited

protected boolean isColumnNameDelimited

introspectedTable

protected IntrospectedTable introspectedTable
Constructor Detail

IntrospectedColumn

public IntrospectedColumn()
Constructs a Column definition. This object holds all the information about a column that is required to generate Java objects and SQL maps;

Method Detail

getJdbcType

public int getJdbcType()

setJdbcType

public void setJdbcType(int jdbcType)

getLength

public int getLength()

setLength

public void setLength(int length)

isNullable

public boolean isNullable()

setNullable

public void setNullable(boolean nullable)

getScale

public int getScale()

setScale

public void setScale(int scale)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

setActualColumnName

public void setActualColumnName(java.lang.String actualColumnName)

isIdentity

public boolean isIdentity()
Returns:
Returns the identity.

setIdentity

public void setIdentity(boolean identity)
Parameters:
identity - The identity to set.

isBLOBColumn

public boolean isBLOBColumn()

isStringColumn

public boolean isStringColumn()

isJdbcCharacterColumn

public boolean isJdbcCharacterColumn()

getJavaProperty

public java.lang.String getJavaProperty()

getJavaProperty

public java.lang.String getJavaProperty(java.lang.String prefix)

setJavaProperty

public void setJavaProperty(java.lang.String javaProperty)

getRenamedColumnNameForResultMap

public java.lang.String getRenamedColumnNameForResultMap()
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

getSelectListPhrase

public java.lang.String getSelectListPhrase()
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

isJDBCDateColumn

public boolean isJDBCDateColumn()

isJDBCTimeColumn

public boolean isJDBCTimeColumn()

getIbatisFormattedParameterClause

public java.lang.String getIbatisFormattedParameterClause()

getIbatisFormattedParameterClause

public java.lang.String getIbatisFormattedParameterClause(java.lang.String prefix)

getTypeHandler

public java.lang.String getTypeHandler()

setTypeHandler

public void setTypeHandler(java.lang.String typeHandler)

getActualColumnName

public java.lang.String getActualColumnName()

getEscapedColumnName

public java.lang.String getEscapedColumnName()

getAliasedActualColumnName

public java.lang.String getAliasedActualColumnName()
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

getAliasedEscapedColumnName

public java.lang.String getAliasedEscapedColumnName()
Calculates the string to use in select phrases in SqlMaps.

Returns:
the aliased escaped column name

setColumnNameDelimited

public void setColumnNameDelimited(boolean isColumnNameDelimited)

isColumnNameDelimited

public boolean isColumnNameDelimited()

getJdbcTypeName

public java.lang.String getJdbcTypeName()

setJdbcTypeName

public void setJdbcTypeName(java.lang.String jdbcTypeName)

getFullyQualifiedJavaType

public FullyQualifiedJavaType getFullyQualifiedJavaType()

setFullyQualifiedJavaType

public void setFullyQualifiedJavaType(FullyQualifiedJavaType fullyQualifiedJavaType)

getTableAlias

public java.lang.String getTableAlias()

setTableAlias

public void setTableAlias(java.lang.String tableAlias)

getIbatorContext

public IbatorContext getIbatorContext()

setIbatorContext

public void setIbatorContext(IbatorContext ibatorContext)

getIntrospectedTable

public IntrospectedTable getIntrospectedTable()

setIntrospectedTable

public void setIntrospectedTable(IntrospectedTable introspectedTable)