com.j256.ormlite.stmt.mapped
Class MappedQueryForId<T,ID>

java.lang.Object
  extended by com.j256.ormlite.stmt.mapped.BaseMappedStatement<T,ID>
      extended by com.j256.ormlite.stmt.mapped.BaseMappedQuery<T,ID>
          extended by com.j256.ormlite.stmt.mapped.MappedQueryForId<T,ID>
All Implemented Interfaces:
GenericRowMapper<T>
Direct Known Subclasses:
MappedRefresh

public class MappedQueryForId<T,ID>
extends BaseMappedQuery<T,ID>

Mapped statement for querying for an object by its ID.

Author:
graywatson

Field Summary
 
Fields inherited from class com.j256.ormlite.stmt.mapped.BaseMappedQuery
resultsFieldTypes
 
Fields inherited from class com.j256.ormlite.stmt.mapped.BaseMappedStatement
argFieldTypes, clazz, idField, logger, statement, tableInfo
 
Constructor Summary
protected MappedQueryForId(TableInfo<T,ID> tableInfo, String statement, FieldType[] argFieldTypes, FieldType[] resultsFieldTypes, String label)
           
 
Method Summary
static
<T,ID> MappedQueryForId<T,ID>
build(DatabaseType databaseType, TableInfo<T,ID> tableInfo)
           
protected static
<T,ID> String
buildStatement(DatabaseType databaseType, TableInfo<T,ID> tableInfo)
           
 T execute(DatabaseConnection databaseConnection, ID id, ObjectCache objectCache)
          Query for an object in the database which matches the id argument.
 
Methods inherited from class com.j256.ormlite.stmt.mapped.BaseMappedQuery
mapRow, setParentObject
 
Methods inherited from class com.j256.ormlite.stmt.mapped.BaseMappedStatement
convertIdToFieldObject, getFieldObjects, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MappedQueryForId

protected MappedQueryForId(TableInfo<T,ID> tableInfo,
                           String statement,
                           FieldType[] argFieldTypes,
                           FieldType[] resultsFieldTypes,
                           String label)
Method Detail

execute

public T execute(DatabaseConnection databaseConnection,
                 ID id,
                 ObjectCache objectCache)
          throws SQLException
Query for an object in the database which matches the id argument.

Throws:
SQLException

build

public static <T,ID> MappedQueryForId<T,ID> build(DatabaseType databaseType,
                                                  TableInfo<T,ID> tableInfo)
                                    throws SQLException
Throws:
SQLException

buildStatement

protected static <T,ID> String buildStatement(DatabaseType databaseType,
                                              TableInfo<T,ID> tableInfo)
                                throws SQLException
Throws:
SQLException


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