Example usage for org.springframework.batch.item.file.transform FieldSet readDate

List of usage examples for org.springframework.batch.item.file.transform FieldSet readDate

Introduction

In this page you can find the example usage for org.springframework.batch.item.file.transform FieldSet readDate.

Prototype

Date readDate(String name, String pattern, Date defaultValue);

Source Link

Document

Read the java.sql.Date value in given format from column with given name.

Usage

From source file:no.magott.training.ex1.SpursMatchFieldSetMapper.java

@Override
public SpursMatch mapFieldSet(FieldSet fieldSet) throws BindException {
    int matchId = fieldSet.readInt("MatchId", 0);
    String day = fieldSet.readString("Day");
    String competition = fieldSet.readString("Competition");
    String opposition = fieldSet.readString("Opposition");
    String venue = fieldSet.readString("Venue");
    String halfTimeScore = fieldSet.readString("HalfTimeScore");
    int spursGoals = fieldSet.readInt("SpursGoals", 0);
    int oppositionGoals = fieldSet.readInt("OppositionGoals", 0);
    Date date = fieldSet.readDate("Date", "MMM d, yyyy", null);

    return new SpursMatch(matchId, day, date, competition, opposition, venue, halfTimeScore, spursGoals,
            oppositionGoals);//  www.ja  v a 2s  .c om
}