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, clazz, 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, ObjectCache objectCache)
          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
mapRow, setParentInformation
 
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
 

Method Detail

executeRefresh

public int executeRefresh(DatabaseConnection databaseConnection,
                          T data,
                          ObjectCache objectCache)
                   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


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