com.j256.ormlite.stmt
Class BaseArgumentHolder

java.lang.Object
  extended by com.j256.ormlite.stmt.BaseArgumentHolder
All Implemented Interfaces:
ArgumentHolder
Direct Known Subclasses:
SelectArg, ThreadLocalSelectArg

public abstract class BaseArgumentHolder
extends Object
implements ArgumentHolder

Base class for other select argument classes.

Author:
graywatson

Constructor Summary
BaseArgumentHolder()
           
BaseArgumentHolder(SqlType sqlType)
           
BaseArgumentHolder(String columName)
           
 
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.
protected abstract  Object getValue()
          Return the stored value.
protected abstract  boolean isValueSet()
          Return true if the value is set.
 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.
abstract  void setValue(Object value)
          Set the value associated with this argument.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BaseArgumentHolder

public BaseArgumentHolder()

BaseArgumentHolder

public BaseArgumentHolder(String columName)

BaseArgumentHolder

public BaseArgumentHolder(SqlType sqlType)
Method Detail

getValue

protected abstract Object getValue()
Return the stored value.


setValue

public abstract void setValue(Object value)
Description copied from interface: ArgumentHolder
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.

Specified by:
setValue in interface ArgumentHolder

isValueSet

protected abstract boolean isValueSet()
Return true if the value is set.


getColumnName

public String getColumnName()
Description copied from interface: ArgumentHolder
Return the column-name associated with this argument. The name is set by the package internally.

Specified by:
getColumnName in interface ArgumentHolder

setMetaInfo

public void setMetaInfo(String columnName)
Description copied from interface: ArgumentHolder
Used internally by the package to set the column-name associated with this argument.

Specified by:
setMetaInfo in interface ArgumentHolder

setMetaInfo

public void setMetaInfo(FieldType fieldType)
Description copied from interface: ArgumentHolder
Used internally by the package to set the fieldType associated with this argument.

Specified by:
setMetaInfo in interface ArgumentHolder

setMetaInfo

public void setMetaInfo(String columnName,
                        FieldType fieldType)
Description copied from interface: ArgumentHolder
Used internally by the package to set the column-name and fieldType associated with this argument.

Specified by:
setMetaInfo in interface ArgumentHolder

getSqlArgValue

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

Specified by:
getSqlArgValue in interface ArgumentHolder
Throws:
SQLException

getFieldType

public FieldType getFieldType()
Description copied from interface: ArgumentHolder
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.

Specified by:
getFieldType in interface ArgumentHolder

getSqlType

public SqlType getSqlType()
Description copied from interface: ArgumentHolder
Return the SQL type associated with this class. Either this or the field-type must be available.

Specified by:
getSqlType in interface ArgumentHolder

toString

public String toString()
Overrides:
toString in class Object


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