package com.iqser.red.service.persistence.management.v1.processor.service.persistence.repository.dictionaryentry;

import java.util.List;
import java.util.Set;

import org.springframework.stereotype.Repository;

import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;
import lombok.experimental.FieldDefaults;

@RequiredArgsConstructor
@FieldDefaults(makeFinal = true, level = AccessLevel.PRIVATE)
@Repository
public class EntryRepositoryImpl implements EntryRepositoryCustom {

    private static final String TABLE_NAME = "dictionary_entry";

    QueryExecutor queryExecutor;


    @Override
    public List<String> undeleteEntries(String typeId, Set<String> entries, long version) {

        return queryExecutor.runUndeleteQueryInBatches(typeId, entries, version, TABLE_NAME);
    }


    @Override
    public void deleteAllByTypeIdAndVersionAndValueIn(String typeId, Set<String> entries, long version) {

        queryExecutor.runDeleteQueryInBatches(typeId, entries, version, TABLE_NAME);
    }

}
