package ru.micord.ervu.account_applications.dao;


import java.util.List;

import org.jooq.DSLContext;
import org.jooq.Table;
import org.springframework.stereotype.Repository;
import ru.micord.ervu.account_applications.db_beans.public_.Tables;
import ru.micord.ervu.account_applications.db_beans.public_.tables.records.SolutionRecord;

/**
 * @author Adel Kalimullin
 */
@Repository
public class SolutionDao extends AbstractDataDao<SolutionRecord> {
  protected SolutionDao(DSLContext dsl) {
    super(dsl);
  }

  public void setActiveStatus(List<String> ids, boolean active) {
    setFieldWhereIn(
        Tables.SOLUTION.ACTIVE, active,
        Tables.SOLUTION.ID, ids
    );
  }

  @Override
  protected Table<SolutionRecord> getTable() {
    return Tables.SOLUTION;
  }
}
