private void refreshInstance ( Object cachedInstance , Identity oid , ClassDescriptor cld ) { // read in fresh copy from the db, but do not cache it Object freshInstance = getPlainDBObject ( cld , oid ) ; // update all primitive typed attributes FieldDescriptor [ ] fields = cld . getFieldDescriptions ( ) ; FieldDescriptor fmd ; PersistentField fld ; for ( int i = 0 ; i < fields . length ; i ++ ) { fmd = fields [ i ] ; fld = fmd . getPersistentField ( ) ; fld . set ( cachedInstance , fld . get ( freshInstance ) ) ; } }
refresh all primitive typed attributes of a cached instance with the current values from the database . refreshing of reference and collection attributes is not done here .