com.j256.ormlite.stmt
Interface ArgumentHolder

All Known Implementing Classes:
BaseSelectArg, SelectArg, ThreadLocalSelectArg

public interface ArgumentHolder

An argument to a select SQL statement. After the query is constructed, the caller can set the value on this argument and run the query. Then the argument can be set again and the query re-executed. This is equivalent in SQL to a ? argument.

Author:
graywatson

Method Summary
 String getColumnName()
          Return the column-name associated with this argument.
 FieldType getFieldType()
          Return the field type associated with this class.
 Object getSqlArgValue()
          Return the value associated with this argument suitable for passing to SQL.
 SqlType getSqlType()
          Return the SQL type associated with this class.
 void setMetaInfo(FieldType fieldType)
          Used internally by the package to set the fieldType associated with this argument.
 void setMetaInfo(String columnName)
          Used internally by the package to set the column-name associated with this argument.
 void setMetaInfo(String columnName, FieldType fieldType)
          Used internally by the package to set the column-name and fieldType associated with this argument.
 void setValue(Object value)
          Set the value associated with this argument.
 

Method Detail

getColumnName

String getColumnName()
Return the column-name associated with this argument. The name is set by the package internally.


setMetaInfo

void setMetaInfo(String columnName)
Used internally by the package to set the column-name associated with this argument.


setMetaInfo

void setMetaInfo(FieldType fieldType)
Used internally by the package to set the fieldType associated with this argument.


setMetaInfo

void setMetaInfo(String columnName,
                 FieldType fieldType)
Used internally by the package to set the column-name and fieldType associated with this argument.


setValue

void setValue(Object value)
Set the value associated with this argument. The value should be set by the user after the query has been built but before it has been executed.


getSqlArgValue

Object getSqlArgValue()
                      throws SQLException
Return the value associated with this argument suitable for passing to SQL. The value should be set by the user before it is consumed.

Throws:
SQLException

getSqlType

SqlType getSqlType()
Return the SQL type associated with this class. Either this or the field-type must be available.


getFieldType

FieldType getFieldType()
Return the field type associated with this class. Either this or the sql-type must be available. The field-type is available if there is a corresponding column-name set on the holder.



This content is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.