15 Aralık 2022 Perşembe

SpringBatch RepositoryItemWriter Sınıfı

Giriş
Şu satırı dahil ederiz
import org.springframework.batch.item.data.RepositoryItemWriter;
setRepository metodu
Örnek
Şöyle yaparız
@Bean(name = "writerRealNewsReportTable")
public RepositoryItemWriter<RealNews> writerRealNewsReportTable(){
    RepositoryItemWriter<RealNews> writer = new RepositoryItemWriter<>();
    writer.setRepository(realNewsRepository);
    writer.setMethodName("save");
    return writer;
}


Hiç yorum yok:

Yorum Gönder