Class HibernateRecordWriter<P>

  • Type Parameters:
    P - type of the record's payload
    All Implemented Interfaces:
    org.jeasy.batch.core.writer.RecordWriter<P>

    public class HibernateRecordWriter<P>
    extends java.lang.Object
    implements org.jeasy.batch.core.writer.RecordWriter<P>
    Writes entities to a database using Hibernate.
    Author:
    Mahmoud Ben Hassine (mahmoud.benhassine@icloud.com)
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      void open()  
      void writeRecords​(org.jeasy.batch.core.record.Batch<P> batch)  
      • Methods inherited from class java.lang.Object

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

      • HibernateRecordWriter

        public HibernateRecordWriter​(org.hibernate.SessionFactory sessionFactory)
        Create a new HibernateRecordWriter.
        Parameters:
        sessionFactory - to create sessions.
    • Method Detail

      • open

        public void open()
        Specified by:
        open in interface org.jeasy.batch.core.writer.RecordWriter<P>
      • writeRecords

        public void writeRecords​(org.jeasy.batch.core.record.Batch<P> batch)
        Specified by:
        writeRecords in interface org.jeasy.batch.core.writer.RecordWriter<P>
      • close

        public void close()
        Specified by:
        close in interface org.jeasy.batch.core.writer.RecordWriter<P>