Interface TeamDaoInterface
- All Known Implementing Classes:
TeamDaoList
public interface TeamDaoInterface
- Author:
- Jordi and David
-
Method Summary
Modifier and TypeMethodDescriptionint
Deletes the team givenint
Inserts a new teamSelects all teams from data sourceselectWhereCategory(String category)
Selects all teams that belongs to a categoryselectWhereCoach(String coach)
Selects teams given name of coachselectWhereId(long id)
Selects a team given idselectWhereName(String name)
Selects a team given nameint
Updates the team given
-
Method Details
-
selectAll
Selects all teams from data source- Returns:
- list of all teams or empty list if none if found or null in case of error
-
selectWhereId
Selects a team given id- Parameters:
id
- the id from the team- Returns:
- a team or empty in case not found, null in case of error
-
selectWhereName
Selects a team given name- Parameters:
name
- the name of the team- Returns:
- a team or empty in case not found, null in case of error
- Throws:
ParameterNull
- in case parameter passed is null a exeception will be throw
-
selectWhereCoach
Selects teams given name of coach- Parameters:
coach
- the name of the coach- Returns:
- list of teams or empty in case not found, null in case of error
- Throws:
ParameterNull
- in case parameter passed is null a exeception will be throw
-
selectWhereCategory
Selects all teams that belongs to a category- Parameters:
category
- the category to seach- Returns:
- list of all teams or empty list if none if found or null in case of error
- Throws:
ParameterNull
- in case parameter passed is null a exeception will be throw
-
insert
Inserts a new team- Parameters:
team
- the team to add- Returns:
- 1 if its correctly inserted or -1 in case of error
- Throws:
ParameterNull
- in case parameter passed is null a exeception will be throwAlreadyExistsTeam
- in case of the new team introduced already exists a exeception will be throw
-
update
Updates the team given- Parameters:
team
- the team to update their data- Returns:
- 1 if its correctly updated or -1 in case of error
- Throws:
ParameterNull
- in case parameter passed is null a exeception will be throw
-
delete
Deletes the team given- Parameters:
team
- the team to delete- Returns:
- 1 if its correctly updated or -1 in case of error
- Throws:
ParameterNull
- in case parameter passed is null a exeception will be throwTeamHavePlayers
- if the team to delete contains player a exeception will be throw
-