code: public Object extractJavaFieldValue(Object object) throws SQLException {
  
  		Object val = extractRawJavaFieldValue(object);
  
  		// if this is a foreign object then we want its reference field
  		if (foreignRefField != null && val != null) {
  			val = foreignRefField.extractRawJavaFieldValue(val);
  		}
  
  		return val;
  	}
docs: Return the value from the field in the object that is defined by this FieldType. If the field is a foreign object
  then the ID of the field is returned instead.