Interface PlayerDaoInterface
- All Known Implementing Classes:
PlayerDaoList
public interface PlayerDaoInterface
- Author:
- Jordi and David
-
Method Summary
Modifier and TypeMethodDescriptionint
Deletes the player givenint
Inserts a new playerSelects all players from data sourceselectWhereId(long id)
Selects a player given idselectWhereName(String name)
Selects a player given nameselectWhereTeamId(long teamId)
Selects player given team IDint
Updates the player given
-
Method Details
-
selectAll
Selects all players from data source- Returns:
- list of all players or empty list if none if found or null in case of error
-
selectWhereId
Selects a player given id- Parameters:
id
- the id from the player- Returns:
- a player or empty in case not found, null in case of error
- Throws:
ParameterNull
- in case parameter passed is null a exeception will be throw
-
selectWhereName
Selects a player given name- Parameters:
name
- the name of the player- Returns:
- a list of players or empty in case not found, null in case of error
- Throws:
ParameterNull
- in case parameter passed is null a exeception will be throw
-
selectWhereTeamId
Selects player given team ID- Parameters:
teamId
- the team id from the player's team- Returns:
- list of players or empty in case not found, null in case of error
- Throws:
ParameterNull
- in case parameter passed is null a exeception will be throw
-
insert
Inserts a new player- Parameters:
player
- the player 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 throwAlreadyExistsPlayer
- in case of the new player introduced already exists a exeception will be throw
-
update
Updates the player given- Parameters:
player
- the player 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 player given- Parameters:
player
- the player 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 throw
-