Project

General

Profile

« Previous | Next » 

Revision 36082

correctly loading null numeric values for requests

View differences:

modules/uoa-goldoa-service/trunk/src/main/java/eu/dnetlib/goldoa/service/dao/RequestDAO.java
38 38
    private RowMapper<Request> requestRowMapper = new RowMapper<Request>() {
39 39
        @Override
40 40
        public Request mapRow(ResultSet rs, int rowNum) throws SQLException {
41
            return new Request(
41
            Request request = new Request(
42 42
                    rs.getString("id"), rs.getString("user"), rs.getTimestamp("date"), rs.getString("researcher"), rs.getString("organization"),
43 43
                    rs.getString("project"), rs.getString("publication"), rs.getString("journal"), rs.getString("publisher"),
44 44
                    rs.getString("budget"), rs.getString("invoice"), rs.getFloat("projectparticipation"), rs.getFloat("fundingrequested"), rs.getInt("status"));
45

  
46
            rs.getFloat("projectparticipation");
47
            if (rs.wasNull())
48
                request.setProjectParticipation(null);
49
            rs.getFloat("fundingrequested");
50
            if (rs.wasNull())
51
                request.setFundingRequested(null);
52

  
53
            return request;
45 54
        }
46 55
    };
47 56

  

Also available in: Unified diff