// Path: projects/03_batch/batch-processing/src/main/java/org/jboss/as/quickstarts/batch/model/Contact.java
// @Entity
// public class Contact {
// 
//     @Id
//     private Integer id;
// 
//     @NotNull
//     @Column(unique = true)
//     private String name;
// 
//     @NotNull
//     private String phone;
// 
//     public Integer getId() {
//         return id;
//     }
// 
//     public void setId(Integer id) {
//         this.id = id;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public void setName(String name) {
//         this.name = name;
//     }
// 
//     public String getPhone() {
//         return phone;
//     }
// 
//     public void setPhone(String phone) {
//         this.phone = phone;
//     }
// 
//     @Override
//     public String toString() {
//         return "Contact [id=" + id + ", name=" + name + ", phone=" + phone + "]";
//     }
// 
// }


import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.Serializable;
import java.util.logging.Logger;
import javax.batch.api.BatchProperty;
import javax.batch.api.chunk.ItemReader;
import javax.inject.Inject;
import javax.inject.Named;
import org.jboss.as.quickstarts.batch.model.Contact;

    private BufferedReader br;

    private ChunkCheckpoint checkpoint;

    @Override
    public void close() throws Exception {
        br.close();
    }

    @Override
    public void open(Serializable previousCheckpoint) throws Exception {
        // Verify if we have an previous checkpoint
        if (previousCheckpoint == null) {
            this.checkpoint = new ChunkCheckpoint();
        }
        else {
            this.checkpoint = (ChunkCheckpoint) previousCheckpoint;
        }
        br = new BufferedReader(new FileReader(new File(System.getProperty("java.io.tmpdir"), fileName)));
        long lineNumber = checkpoint.getLineNumber();
        if (lineNumber > 0) {
            log.info("Skipping to line " + lineNumber + " as marked by previous checkpoint");
        }
        for (long i = 0; i < lineNumber; i++) {
            br.readLine();
        }
    }

    @Override
// Path: projects/03_batch/batch-processing/src/main/java/org/jboss/as/quickstarts/batch/model/Contact.java
// @Entity
// public class Contact {
// 
//     @Id
//     private Integer id;
// 
//     @NotNull
//     @Column(unique = true)
//     private String name;
// 
//     @NotNull
//     private String phone;
// 
//     public Integer getId() {
//         return id;
//     }
// 
//     public void setId(Integer id) {
//         this.id = id;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public void setName(String name) {
//         this.name = name;
//     }
// 
//     public String getPhone() {
//         return phone;
//     }
// 
//     public void setPhone(String phone) {
//         this.phone = phone;
//     }
// 
//     @Override
//     public String toString() {
//         return "Contact [id=" + id + ", name=" + name + ", phone=" + phone + "]";
//     }
// 
// }


// Path: projects/03_batch/batch-processing/src/main/java/org/jboss/as/quickstarts/batch/job/RecordsReader.java
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.Serializable;
import java.util.logging.Logger;
import javax.batch.api.BatchProperty;
import javax.batch.api.chunk.ItemReader;
import javax.inject.Inject;
import javax.inject.Named;
import org.jboss.as.quickstarts.batch.model.Contact;


    private BufferedReader br;

    private ChunkCheckpoint checkpoint;

    @Override
    public void close() throws Exception {
        br.close();
    }

    @Override
    public void open(Serializable previousCheckpoint) throws Exception {
        // Verify if we have an previous checkpoint
        if (previousCheckpoint == null) {
            this.checkpoint = new ChunkCheckpoint();
        }
        else {
            this.checkpoint = (ChunkCheckpoint) previousCheckpoint;
        }
        br = new BufferedReader(new FileReader(new File(System.getProperty("java.io.tmpdir"), fileName)));
        long lineNumber = checkpoint.getLineNumber();
        if (lineNumber > 0) {
            log.info("Skipping to line " + lineNumber + " as marked by previous checkpoint");
        }
        for (long i = 0; i < lineNumber; i++) {
            br.readLine();
        }
    }

    @Override
    public Contact readItem() throws Exception {