Example #1
0
 /*
  * (non-Javadoc)
  *
  * @see org.cuny.sensors.dao.IDao#save(java.lang.Object)
  */
 @Override
 public RawFile save(RawFile obj) throws Exception {
   Map<String, Object> parameters = new HashMap<String, Object>(5);
   parameters.put(FILE_NAME, obj.getFilename());
   parameters.put(FILE_SIZE, obj.getFileSize());
   parameters.put(STATUS, obj.getStatus().toString());
   parameters.put(BUILDING, obj.getBuilding());
   parameters.put(CAMPUS, obj.getCampus());
   Number newId = insertActor.executeAndReturnKey(parameters);
   obj.setId(newId.longValue());
   return obj;
 }
Example #2
0
 /*
  * (non-Javadoc)
  *
  * @see
  * org.springframework.jdbc.core.RowMapper#mapRow(java.sql.ResultSet,
  * int)
  */
 @Override
 public RawFile mapRow(ResultSet rs, int rowNum) throws SQLException {
   RawFile rawfile = new RawFile();
   rawfile.setId(rs.getLong(ID));
   rawfile.setFilename(rs.getString(FILE_NAME));
   rawfile.setFileSize(rs.getLong(FILE_SIZE));
   rawfile.setDatasetCount(rs.getInt(DATASET_COUNT));
   rawfile.setSensorCount(rs.getInt(SENSOR_COUNT));
   rawfile.setRecordCount(rs.getLong(RECORD_COUNT));
   rawfile.setBuilding(rs.getString(BUILDING));
   rawfile.setCampus(rs.getString(CAMPUS));
   rawfile.setStatus(RawFileStatus.valueOf(rs.getString(STATUS)));
   rawfile.setNotes(rs.getString(NOTES));
   rawfile.setImportedTime(rs.getDate(IMPORT_TIME));
   rawfile.setBplRawfileId(rs.getLong(BPL_RAW_FILE_ID));
   return rawfile;
 }