title: Using hibernate in Spring batch to read data
body: <p>I am working in a project where we are using Spring batch framework. I am novice to it.  </p>
  
  <p>I have a task which is like reading a fixed length flat file length and then process it and populate some bean and after that using some value from the request I have to fetch data from Database using Oracle and then generate some response as a fixed length flat file.  </p>
  
  <p>I have pasted below the little code snippet from configuration file.</p>
  
  <pre><code>&lt;bean name="tickerReader"
          class="org.springframework.batch.item.file.FlatFileItemReader"&gt;
          &lt;property name="resource" ref="fileSystemResource" /&gt;
          &lt;property name="lineMapper" ref="tickerLineMapper" /&gt;
  &lt;bean&gt;
   ..............................
   ..............................
  
  &lt;batch:job id="TickerPriceConversion"&gt;
          &lt;batch:step id="convertPrice"&gt;
              &lt;batch:tasklet transaction-manager="transactionManager"&gt;
                  &lt;batch:chunk reader="tickerReader" processor="tickerPriceProcessor"
                      writer="simbeqResponseFlatFileWriter" commit-interval="10" &gt;
              &lt;/batch:chunk&gt;
              &lt;/batch:tasklet&gt;
          &lt;/batch:step&gt;
      &lt;/batch:job&gt;
  </code></pre>
  
  <p>I have done the reading part i.e. reading the request file and populated the corresponding bean. Now I need to fetch data from Oracle using hibernate corresponding to the data from the request. I am not sure how to do it? How should i go about it means configuring session factory and using it to fetch data. </p>
  
  <p>Can someone please guide me?</p>