@Override public RecordArticleStatAllTimeModel mapRow(ResultSet resultSet, int i) throws SQLException { RecordArticleStatAllTimeModel recordArticleStatAllTimeModel = new RecordArticleStatAllTimeModel(); recordArticleStatAllTimeModel.setId(resultSet.getLong("id")); recordArticleStatAllTimeModel.setUniqueVisitor(resultSet.getInt("uniquevisitor")); recordArticleStatAllTimeModel.setUniqueVisitorArticleId( resultSet.getString("uniquevisitorarticleid")); recordArticleStatAllTimeModel.setUniqueVisitorArticleTitle( resultSet.getString("uniquevisitorarticletitle")); recordArticleStatAllTimeModel.setUniqueVisitorArticleUrl( resultSet.getString("uniquevisitorarticleurl")); recordArticleStatAllTimeModel.setPageView(resultSet.getInt("pageview")); recordArticleStatAllTimeModel.setPageViewArticleId(resultSet.getString("pageviewarticleid")); recordArticleStatAllTimeModel.setPageViewArticleTitle( resultSet.getString("pageviewarticletitle")); recordArticleStatAllTimeModel.setPageViewArticleUrl( resultSet.getString("pageviewarticleurl")); recordArticleStatAllTimeModel.setVisit(resultSet.getInt("visit")); recordArticleStatAllTimeModel.setVisitArticleId(resultSet.getString("visitarticleid")); recordArticleStatAllTimeModel.setVisitArticleTitle(resultSet.getString("visitarticletitle")); recordArticleStatAllTimeModel.setVisitArticleUrl(resultSet.getString("visitarticleurl")); recordArticleStatAllTimeModel.setSite(siteDao.findById(resultSet.getLong("site_id"))); return recordArticleStatAllTimeModel; }
private RecordArticleStatAllTimeModel addRecordArticleStatAllTimeModel( RecordArticleStatAllTimeModel model) { GeneratedKeyHolder keyHolder = new GeneratedKeyHolder(); jdbcTemplate.update(new RecordArticleStatAllTimePrepareStatementCreator(model), keyHolder); long key = keyHolder.getKey().longValue(); model.setId(key); return model; }