public void fromDBObject(final DBObject dbObj, final MappedField mf, final Object targetEntity) {
        final Object object = mf.getDbObjectValue(dbObj);
        if (object != null) {
            final TypeConverter enc = getEncoder(mf);
            final Object decodedValue = enc.decode(mf.getType(), object, mf);
            try {
                mf.setFieldValue(targetEntity, decodedValue);
            } catch (IllegalArgumentException e) {
                throw new MappingException(format("Error setting value from converter (%s) for %s to %s",
                                                  enc.getClass().getSimpleName(), mf.getFullName(), decodedValue), e);
            }
        }
    }
public void fromDBObject ( final DBObject dbObj , final MappedField mf , final Object targetEntity ) { final Object object = mf . getDbObjectValue ( dbObj ) ; if ( object != null ) { final TypeConverter enc = getEncoder ( mf ) ; final Object decodedValue = enc . decode ( mf . getType ( ) , object , mf ) ; try { mf . setFieldValue ( targetEntity , decodedValue ) ; } catch ( IllegalArgumentException e ) { throw new MappingException ( format ( "Error setting value from converter (%s) for %s to %s" , enc . getClass ( ) . getSimpleName ( ) , mf . getFullName ( ) , decodedValue ) , e ) ; } } }
Creates an entity and populates its state based on the dbObject given.  This method is primarily an internal method.  Reliance on
this method may break your application in future releases.

@param dbObj        the object state to use
@param mf           the MappedField containing the metadata to use when decoding in to a field
@param targetEntity then entity to hold the state from the database