com.j256.ormlite.stmt.mapped
Class MappedRefresh<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>
              extended by com.j256.ormlite.stmt.mapped.MappedRefresh<T,ID>
All Implemented Interfaces:
GenericRowMapper<T>

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

Mapped statement for refreshing the fields in an object.

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, idField, logger, statement, tableInfo
 
Method Summary
static
<T,ID> MappedRefresh<T,ID>
build(DatabaseType databaseType, TableInfo<T,ID> tableInfo)
           
 int executeRefresh(DatabaseConnection databaseConnection, T data)
          Execute our refresh query statement and then update all of the fields in data with the fields from the result.
 
Methods inherited from class com.j256.ormlite.stmt.mapped.MappedQueryForId
buildStatement, execute
 
Methods inherited from class com.j256.ormlite.stmt.mapped.BaseMappedQuery
getResultsFieldTypes, mapRow
 
Methods inherited from class com.j256.ormlite.stmt.mapped.BaseMappedStatement
convertIdToFieldObject, delete, extractIdToFieldObject, getFieldObjects, getStatement, insert, toString, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

executeRefresh

public int executeRefresh(DatabaseConnection databaseConnection,
                          T data)
                   throws SQLException
Execute our refresh query statement and then update all of the fields in data with the fields from the result.

Returns:
1 if we found the object in the table by id or 0 if not.
Throws:
SQLException

build

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


Copyright © 2011. All Rights Reserved.