package ru.micord.ervu.account_applications.component.field.persist;

import component.field.dataconvert.DataConverter;
import component.field.dataconvert.DataConverterProvider;
import component.field.persist.AbstractGraphPersistComponent;
import service.FormGraphSource;

import ru.cg.webbpm.modules.database.bean.annotation.GraphSource;
import ru.cg.webbpm.modules.database.bean.entity_graph.EntityColumn;
import ru.cg.webbpm.modules.standard_annotations.validation.NotNull;

/**
 * @author Adel Kalimullin
 */
public class DropDownTree extends AbstractGraphPersistComponent<Object, Object> {
  @GraphSource(FormGraphSource.class)
  @NotNull()
  public EntityColumn columnForSave;

  @Override
  protected DataConverter<Object, Object> getDataConverter() {
    return (DataConverter) DataConverterProvider.getDataConverter(columnForSave.getType());
  }

  @Override
  public EntityColumn getEntityColumn() {
    return columnForSave;
  }
}
