docs: public static void writeConfig(BufferedWriter writer, DatabaseFieldConfig config, String tableName)
  			throws IOException {
  		writer.append(CONFIG_FILE_START_MARKER);
  		writer.newLine();
  		if (config.getFieldName() != null) {
  			writer.append(FIELD_NAME_FIELD_NAME).append('=').append(config.getFieldName());
  			writer.newLine();
  		}
  		if (config.getColumnName() != null) {
  			writer.append(FIELD_NAME_COLUMN_NAME).append('=').append(config.getColumnName());
  			writer.newLine();
  		}
  		if (config.getDataPersister() != DEFAULT_DATA_PERSISTER) {
  			boolean found = false;
  			for (DataType dataType : DataType.values()) {
  				if (dataType.getDataPersister() == config.getDataPersister()) {
  					writer.append(FIELD_NAME_DATA_PERSISTER).append('=').append(dataType.name());
  					writer.newLine();
  					found = true;
  					break;
  				}
  			}
  			if (!found) {
  				throw new IllegalArgumentException("Unknown data persister field: " + config.getDataPersister());
  			}
  		}
  		if (config.getDefaultValue() != null) {
  			writer.append(FIELD_NAME_DEFAULT_VALUE).append('=').append(config.getDefaultValue());
  			writer.newLine();
  		}
  		if (config.getWidth() != 0) {
  			writer.append(FIELD_NAME_WIDTH).append('=').append(Integer.toString(config.getWidth()));
  			writer.newLine();
  		}
  		if (config.isCanBeNull() != DatabaseFieldConfig.DEFAULT_CAN_BE_NULL) {
  			writer.append(FIELD_NAME_CAN_BE_NULL).append('=').append(Boolean.toString(config.isCanBeNull()));
  			writer.newLine();
  		}
  		if (config.isId()) {
  			writer.append(FIELD_NAME_ID).append('=').append("true");
  			writer.newLine();
  		}
  		if (config.isGeneratedId()) {
  			writer.append(FIELD_NAME_GENERATED_ID).append('=').append("true");
  			writer.newLine();
  		}
  		if (config.getGeneratedIdSequence() != null) {
  			writer.append(FIELD_NAME_GENERATED_ID_SEQUENCE).append('=').append(config.getGeneratedIdSequence());
  			writer.newLine();
  		}
  		if (config.isForeign()) {
  			writer.append(FIELD_NAME_FOREIGN).append('=').append("true");
  			writer.newLine();
  		}
  		if (config.isUseGetSet()) {
  			writer.append(FIELD_NAME_USE_GET_SET).append('=').append("true");
  			writer.newLine();
  		}
  		if (config.getUnknownEnumValue() != null) {
  			/**
  			 * NOTE: we need to use getDeclaringClass() below. If we use getClass() then for anonymous enum types, we
  			 * get an extraneous $1 in the class name. Did not know that. See Enum#getDeclaringClass().  See bug #197.
  			 */
  			writer.append(FIELD_NAME_UNKNOWN_ENUM_VALUE)
  					.append('=')
  					.append(config.getUnknownEnumValue().getDeclaringClass().getName())
  					.append('#')
  					.append(config.getUnknownEnumValue().name());
  			writer.newLine();
  		}
  		if (config.isThrowIfNull()) {
  			writer.append(FIELD_NAME_THROW_IF_NULL).append('=').append("true");
  			writer.newLine();
  		}
  		if (config.getFormat() != null) {
  			writer.append(FIELD_NAME_FORMAT).append('=').append(config.getFormat());
  			writer.newLine();
  		}
  		if (config.isUnique()) {
  			writer.append(FIELD_NAME_UNIQUE).append('=').append("true");
  			writer.newLine();
  		}
  		if (config.isUniqueCombo()) {
  			writer.append(FIELD_NAME_UNIQUE_COMBO).append('=').append("true");
  			writer.newLine();
  		}
  		String indexName = config.getIndexName(tableName);
  		if (indexName != null) {
  			writer.append(FIELD_NAME_INDEX_NAME).append('=').append(indexName);
  			writer.newLine();
  		}
  		String uniqueIndexName = config.getUniqueIndexName(tableName);
  		if (uniqueIndexName != null) {
  			writer.append(FIELD_NAME_UNIQUE_INDEX_NAME).append('=').append(uniqueIndexName);
  			writer.newLine();
  		}
  		if (config.isForeignAutoRefresh()) {
  			writer.append(FIELD_NAME_FOREIGN_AUTO_REFRESH).append('=').append("true");
  			writer.newLine();
  		}
  		if (config.getMaxForeignAutoRefreshLevel() != DatabaseFieldConfig.NO_MAX_FOREIGN_AUTO_REFRESH_LEVEL_SPECIFIED) {
  			writer.append(FIELD_NAME_MAX_FOREIGN_AUTO_REFRESH_LEVEL)
  					.append('=')
  					.append(Integer.toString(config.getMaxForeignAutoRefreshLevel()));
  			writer.newLine();
  		}
  		if (config.getPersisterClass() != DatabaseFieldConfig.DEFAULT_PERSISTER_CLASS) {
  			writer.append(FIELD_NAME_PERSISTER_CLASS).append('=').append(config.getPersisterClass().getName());
  			writer.newLine();
  		}
  		if (config.isAllowGeneratedIdInsert()) {
  			writer.append(FIELD_NAME_ALLOW_GENERATED_ID_INSERT).append('=').append("true");
  			writer.newLine();
  		}
  		if (config.getColumnDefinition() != null) {
  			writer.append(FIELD_NAME_COLUMN_DEFINITION).append('=').append(config.getColumnDefinition());
  			writer.newLine();
  		}
  		if (config.getFullColumnDefinition() != null) {
  			writer.append(FIELD_NAME_FULL_COLUMN_DEFINITION).append('=').append(config.getFullColumnDefinition());
  			writer.newLine();
  		}
  		if (config.isForeignAutoCreate()) {
  			writer.append(FIELD_NAME_FOREIGN_AUTO_CREATE).append('=').append("true");
  			writer.newLine();
  		}
  		if (config.isVersion()) {
  			writer.append(FIELD_NAME_VERSION).append('=').append("true");
  			writer.newLine();
  		}
  		String foreignColumnName = config.getForeignColumnName();
  		if (foreignColumnName != null) {
  			writer.append(FIELD_NAME_FOREIGN_COLUMN_NAME).append('=').append(foreignColumnName);
  			writer.newLine();
  		}
  		if (config.isReadOnly()) {
  			writer.append(FIELD_NAME_READ_ONLY).append('=').append("true");
  			writer.newLine();
  		}
  
  		/*
  		 * Foreign collection settings:
  		 */
  		if (config.isForeignCollection()) {
  			writer.append(FIELD_NAME_FOREIGN_COLLECTION).append('=').append("true");
  			writer.newLine();
  		}
  		if (config.isForeignCollectionEager()) {
  			writer.append(FIELD_NAME_FOREIGN_COLLECTION_EAGER).append('=').append("true");
  			writer.newLine();
  		}
  		if (config.getForeignCollectionMaxEagerLevel() != DEFAULT_MAX_EAGER_FOREIGN_COLLECTION_LEVEL) {
  			writer.append(FIELD_NAME_MAX_EAGER_FOREIGN_COLLECTION_LEVEL)
  					.append('=')
  					.append(Integer.toString(config.getForeignCollectionMaxEagerLevel()));
  			writer.newLine();
  		}
  		if (config.getForeignCollectionColumnName() != null) {
  			writer.append(FIELD_NAME_FOREIGN_COLLECTION_COLUMN_NAME)
  					.append('=')
  					.append(config.getForeignCollectionColumnName());
  			writer.newLine();
  		}
  		if (config.getForeignCollectionOrderColumnName() != null) {
  			writer.append(FIELD_NAME_FOREIGN_COLLECTION_ORDER_COLUMN_NAME)
  					.append('=')
  					.append(config.getForeignCollectionOrderColumnName());
  			writer.newLine();
  		}
  		if (config.isForeignCollectionOrderAscending() != DatabaseFieldConfig.DEFAULT_FOREIGN_COLLECTION_ORDER_ASCENDING) {
  			writer.append(FIELD_NAME_FOREIGN_COLLECTION_ORDER_ASCENDING)
  					.append('=')
  					.append(Boolean.toString(config.isForeignCollectionOrderAscending()));
  			writer.newLine();
  		}
  		if (config.getForeignCollectionForeignFieldName() != null) {
  			writer.append(FIELD_NAME_FOREIGN_COLLECTION_FOREIGN_FIELD_NAME)
  					.append('=')
  					.append(config.getForeignCollectionForeignFieldName());
  			writer.newLine();
  		}
  
  		writer.append(CONFIG_FILE_END_MARKER);
  		writer.newLine();
  	}