public int executeRefresh ( DatabaseConnection databaseConnection , T data , ObjectCache objectCache ) throws SQLException { @ SuppressWarnings ( "unchecked" ) ID id = ( ID ) idField . extractJavaFieldValue ( data ) ; // we don't care about the cache here T result = super . execute ( databaseConnection , id , null ) ; if ( result == null ) { return 0 ; } // copy each field from the result into the passed in object for ( FieldType fieldType : resultsFieldTypes ) { if ( fieldType != idField ) { fieldType . assignField ( connectionSource , data , fieldType . extractJavaFieldValue ( result ) , false , objectCache ) ; } } return 1 ; }
Execute our refresh query statement and then update all of the fields in data with the fields from the result .