@Test public void testQuery() throws Exception { groupTagDao.insertOrUpdate(newGroupTag()); groupTagDao.insertOrUpdate(newGroupTag()); Assert.assertTrue(groupTagDao.query().size() >= 2); }
public List<GroupTagModel> query() { return DataConfig.jdbcTemplate().query("select group_id, tag, value from service_group_tag", new RowMapper<GroupTagModel>() { @Override public GroupTagModel mapRow(ResultSet rs, int i) throws SQLException { GroupTagModel tag = new GroupTagModel(); tag.setGroupId(rs.getLong(1)); tag.setTag(rs.getString(2)); tag.setValue(rs.getString(3)); return tag; } }); }
GroupTagDao { public List<GroupTagModel> query() { return DataConfig.jdbcTemplate().query("select group_id, tag, value from service_group_tag", new RowMapper<GroupTagModel>() { @Override public GroupTagModel mapRow(ResultSet rs, int i) throws SQLException { GroupTagModel tag = new GroupTagModel(); tag.setGroupId(rs.getLong(1)); tag.setTag(rs.getString(2)); tag.setValue(rs.getString(3)); return tag; } }); } }
GroupTagDao { public List<GroupTagModel> query() { return DataConfig.jdbcTemplate().query("select group_id, tag, value from service_group_tag", new RowMapper<GroupTagModel>() { @Override public GroupTagModel mapRow(ResultSet rs, int i) throws SQLException { GroupTagModel tag = new GroupTagModel(); tag.setGroupId(rs.getLong(1)); tag.setTag(rs.getString(2)); tag.setValue(rs.getString(3)); return tag; } }); } private  GroupTagDao(); }
GroupTagDao { public List<GroupTagModel> query() { return DataConfig.jdbcTemplate().query("select group_id, tag, value from service_group_tag", new RowMapper<GroupTagModel>() { @Override public GroupTagModel mapRow(ResultSet rs, int i) throws SQLException { GroupTagModel tag = new GroupTagModel(); tag.setGroupId(rs.getLong(1)); tag.setTag(rs.getString(2)); tag.setValue(rs.getString(3)); return tag; } }); } private  GroupTagDao(); List<GroupTagModel> query(); void delete(GroupTagModel filter); void insertOrUpdate(GroupTagModel... models); void insertOrUpdate(final List<GroupTagModel> models); }
GroupTagDao { public List<GroupTagModel> query() { return DataConfig.jdbcTemplate().query("select group_id, tag, value from service_group_tag", new RowMapper<GroupTagModel>() { @Override public GroupTagModel mapRow(ResultSet rs, int i) throws SQLException { GroupTagModel tag = new GroupTagModel(); tag.setGroupId(rs.getLong(1)); tag.setTag(rs.getString(2)); tag.setValue(rs.getString(3)); return tag; } }); } private  GroupTagDao(); List<GroupTagModel> query(); void delete(GroupTagModel filter); void insertOrUpdate(GroupTagModel... models); void insertOrUpdate(final List<GroupTagModel> models); static final GroupTagDao INSTANCE; }