@Test public void testGetByTeamIdentifierAndExternalGroupIdentifier() throws Exception { String teamId = TEAM_OKKE; String externalGroupIdentifier = HZ_GROUP_IDENT; final TeamExternalGroup teamExternalGroup = teamExternalGroupDao.getByTeamIdentifierAndExternalGroupIdentifier(teamId, externalGroupIdentifier); assertNotNull(teamExternalGroup); assertEquals(externalGroupIdentifier, teamExternalGroup.getExternalGroup().getIdentifier()); }
@Override public TeamExternalGroup getByTeamIdentifierAndExternalGroupIdentifier(String teamId, String externalGroupIdentifier) { Object[] args = {teamId, externalGroupIdentifier}; String s = "SELECT teg.id AS teg_id, teg.grouper_team_id, eg.id AS eg_id, eg.identifier, eg.name, eg.description, eg.group_provider " + " FROM team_external_groups AS teg " + " INNER JOIN external_groups AS eg " + " ON teg.external_groups_id = eg.id " + " WHERE teg.grouper_team_id = ? AND eg.identifier = ?"; try { return this.jdbcTemplate.queryForObject(s, args, new RowMapper<TeamExternalGroup>() { @Override public TeamExternalGroup mapRow(ResultSet rs, int rowNum) throws SQLException { return mapRowToTeamExternalGroup(rs); } }); } catch (EmptyResultDataAccessException er) { return null; } }
TeamExternalGroupDaoImpl implements TeamExternalGroupDao { @Override public TeamExternalGroup getByTeamIdentifierAndExternalGroupIdentifier(String teamId, String externalGroupIdentifier) { Object[] args = {teamId, externalGroupIdentifier}; String s = "SELECT teg.id AS teg_id, teg.grouper_team_id, eg.id AS eg_id, eg.identifier, eg.name, eg.description, eg.group_provider " + " FROM team_external_groups AS teg " + " INNER JOIN external_groups AS eg " + " ON teg.external_groups_id = eg.id " + " WHERE teg.grouper_team_id = ? AND eg.identifier = ?"; try { return this.jdbcTemplate.queryForObject(s, args, new RowMapper<TeamExternalGroup>() { @Override public TeamExternalGroup mapRow(ResultSet rs, int rowNum) throws SQLException { return mapRowToTeamExternalGroup(rs); } }); } catch (EmptyResultDataAccessException er) { return null; } } }
TeamExternalGroupDaoImpl implements TeamExternalGroupDao { @Override public TeamExternalGroup getByTeamIdentifierAndExternalGroupIdentifier(String teamId, String externalGroupIdentifier) { Object[] args = {teamId, externalGroupIdentifier}; String s = "SELECT teg.id AS teg_id, teg.grouper_team_id, eg.id AS eg_id, eg.identifier, eg.name, eg.description, eg.group_provider " + " FROM team_external_groups AS teg " + " INNER JOIN external_groups AS eg " + " ON teg.external_groups_id = eg.id " + " WHERE teg.grouper_team_id = ? AND eg.identifier = ?"; try { return this.jdbcTemplate.queryForObject(s, args, new RowMapper<TeamExternalGroup>() { @Override public TeamExternalGroup mapRow(ResultSet rs, int rowNum) throws SQLException { return mapRowToTeamExternalGroup(rs); } }); } catch (EmptyResultDataAccessException er) { return null; } }  }
TeamExternalGroupDaoImpl implements TeamExternalGroupDao { @Override public TeamExternalGroup getByTeamIdentifierAndExternalGroupIdentifier(String teamId, String externalGroupIdentifier) { Object[] args = {teamId, externalGroupIdentifier}; String s = "SELECT teg.id AS teg_id, teg.grouper_team_id, eg.id AS eg_id, eg.identifier, eg.name, eg.description, eg.group_provider " + " FROM team_external_groups AS teg " + " INNER JOIN external_groups AS eg " + " ON teg.external_groups_id = eg.id " + " WHERE teg.grouper_team_id = ? AND eg.identifier = ?"; try { return this.jdbcTemplate.queryForObject(s, args, new RowMapper<TeamExternalGroup>() { @Override public TeamExternalGroup mapRow(ResultSet rs, int rowNum) throws SQLException { return mapRowToTeamExternalGroup(rs); } }); } catch (EmptyResultDataAccessException er) { return null; } }  void setJdbcTemplate(JdbcTemplate tpl); @Override ExternalGroup getExternalGroupByIdentifier(String identifier); @Override List<TeamExternalGroup> getByTeamIdentifier(String identifier); @Override List<TeamExternalGroup> getByExternalGroupIdentifier(String identifier); @Override TeamExternalGroup getByTeamIdentifierAndExternalGroupIdentifier(String teamId, String externalGroupIdentifier); @Override void saveOrUpdate(TeamExternalGroup teamExternalGroup); @Override void delete(TeamExternalGroup teamExternalGroup); @Override List<TeamExternalGroup> getByExternalGroupIdentifiers(Collection<String> identifiers); }
TeamExternalGroupDaoImpl implements TeamExternalGroupDao { @Override public TeamExternalGroup getByTeamIdentifierAndExternalGroupIdentifier(String teamId, String externalGroupIdentifier) { Object[] args = {teamId, externalGroupIdentifier}; String s = "SELECT teg.id AS teg_id, teg.grouper_team_id, eg.id AS eg_id, eg.identifier, eg.name, eg.description, eg.group_provider " + " FROM team_external_groups AS teg " + " INNER JOIN external_groups AS eg " + " ON teg.external_groups_id = eg.id " + " WHERE teg.grouper_team_id = ? AND eg.identifier = ?"; try { return this.jdbcTemplate.queryForObject(s, args, new RowMapper<TeamExternalGroup>() { @Override public TeamExternalGroup mapRow(ResultSet rs, int rowNum) throws SQLException { return mapRowToTeamExternalGroup(rs); } }); } catch (EmptyResultDataAccessException er) { return null; } }  void setJdbcTemplate(JdbcTemplate tpl); @Override ExternalGroup getExternalGroupByIdentifier(String identifier); @Override List<TeamExternalGroup> getByTeamIdentifier(String identifier); @Override List<TeamExternalGroup> getByExternalGroupIdentifier(String identifier); @Override TeamExternalGroup getByTeamIdentifierAndExternalGroupIdentifier(String teamId, String externalGroupIdentifier); @Override void saveOrUpdate(TeamExternalGroup teamExternalGroup); @Override void delete(TeamExternalGroup teamExternalGroup); @Override List<TeamExternalGroup> getByExternalGroupIdentifiers(Collection<String> identifiers);  }