Class CsvDatasetConfiguration

java.lang.Object
com.samupert.univpm.eurostat.dataset.CsvDatasetConfiguration

@Configuration @DependsOn("CsvDatasetResource") public class CsvDatasetConfiguration extends Object
CSV dataset configuration.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.batch.core.Job
    csvDatasetImportJob(org.springframework.batch.core.repository.JobRepository jobRepository, org.springframework.batch.core.Step csvDatasetImportStep)
    Job to import the CSV dataset.
    org.springframework.batch.core.Step
    csvDatasetImportStep(org.springframework.batch.core.repository.JobRepository jobRepository, org.springframework.transaction.PlatformTransactionManager transactionManager, org.springframework.batch.item.ItemReader<MonetaryPoverty> csvItemReader, org.springframework.batch.item.ItemWriter<MonetaryPoverty> csvItemWriter)
    Step to import the CSV dataset.
    org.springframework.batch.item.ItemReader<MonetaryPoverty>
    csvItemReader(org.springframework.core.io.Resource csvResource)
    Reader to read the CSV dataset.
    org.springframework.batch.item.ItemWriter<MonetaryPoverty>
    csvItemWriter(jakarta.persistence.EntityManagerFactory entityManagerFactory)
    Writer to write the CSV dataset to.
    org.springframework.batch.item.file.mapping.FieldSetMapper<MonetaryPoverty>
    Field set mapper to map the CSV dataset rows to the MonetaryPoverty class.
    org.springframework.batch.item.file.LineMapper<MonetaryPoverty>
    Line mapper to map the CSV dataset rows to the MonetaryPoverty class.
    org.springframework.batch.item.file.transform.LineTokenizer
    Line tokenizer to tokenize the CSV dataset rows.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CsvDatasetConfiguration

      public CsvDatasetConfiguration()
  • Method Details

    • csvDatasetImportJob

      @Bean public org.springframework.batch.core.Job csvDatasetImportJob(org.springframework.batch.core.repository.JobRepository jobRepository, org.springframework.batch.core.Step csvDatasetImportStep)
      Job to import the CSV dataset.
      Parameters:
      jobRepository - The repository where the jobs are stored.
      csvDatasetImportStep - The step to import the CSV dataset.
      Returns:
      The job to import the CSV dataset.
    • csvDatasetImportStep

      @Bean public org.springframework.batch.core.Step csvDatasetImportStep(org.springframework.batch.core.repository.JobRepository jobRepository, org.springframework.transaction.PlatformTransactionManager transactionManager, org.springframework.batch.item.ItemReader<MonetaryPoverty> csvItemReader, org.springframework.batch.item.ItemWriter<MonetaryPoverty> csvItemWriter)
      Step to import the CSV dataset.
      Parameters:
      jobRepository - The repository where the jobs are stored.
      transactionManager - The transaction manager used to execute the steps.
      csvItemReader - The reader to read the CSV dataset.
      csvItemWriter - The writer to write the CSV dataset to.
      Returns:
      The step to import the CSV dataset.
    • csvItemReader

      @Bean public org.springframework.batch.item.ItemReader<MonetaryPoverty> csvItemReader(org.springframework.core.io.Resource csvResource)
      Reader to read the CSV dataset.
      Parameters:
      csvResource - The CSV dataset resource to import.
      Returns:
      The reader to read the CSV dataset.
    • csvItemWriter

      @Bean public org.springframework.batch.item.ItemWriter<MonetaryPoverty> csvItemWriter(jakarta.persistence.EntityManagerFactory entityManagerFactory) throws Exception
      Writer to write the CSV dataset to.
      Parameters:
      entityManagerFactory - The entity manager factory to use to write the CSV dataset to.
      Returns:
      The writer to write the CSV dataset to.
      Throws:
      Exception - When the writer cannot be created.
    • lineMapper

      @Bean public org.springframework.batch.item.file.LineMapper<MonetaryPoverty> lineMapper()
      Line mapper to map the CSV dataset rows to the MonetaryPoverty class.
      Returns:
      The line mapper to map the CSV dataset.
    • lineTokenizer

      @Bean public org.springframework.batch.item.file.transform.LineTokenizer lineTokenizer()
      Line tokenizer to tokenize the CSV dataset rows.
      Returns:
      The line tokenizer to tokenize the CSV dataset.
    • fieldSetMapper

      @Bean public org.springframework.batch.item.file.mapping.FieldSetMapper<MonetaryPoverty> fieldSetMapper()
      Field set mapper to map the CSV dataset rows to the MonetaryPoverty class.
      Returns:
      The field set mapper to map the CSV dataset rows to the MonetaryPoverty class.