Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //service
- public List<TEAM> getTeamsInTournament(int tournamentID){
- List<BigDecimal> teamIDS = dao.getTeamIDSInTournament(tournamentID);
- List<TEAM> teamList = new ArrayList<>();
- for(BigDecimal teamId : teamIDS){
- teamList.add(teamService.getTeamByID(teamId.intValue()));
- }
- return teamList;
- }
- //dao
- public List<BigDecimal> getTeamIDSInTournament(int tournamentID) {
- String queryStr = String.format("select TEAMID from TEAM_TOURNAMENT where TOURNAMENTID=%d", tournamentID);
- Query query = entityManager.createNativeQuery(queryStr);
- List<BigDecimal> teamList = query.getResultList();
- return teamList;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement