Interface PlayerDaoInterface

All Known Implementing Classes:
PlayerDaoList

public interface PlayerDaoInterface
Author:
Jordi and David
  • Method Details

    • selectAll

      List<Player> 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

      Player selectWhereId(long id) throws ParameterNull
      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

      List<Player> selectWhereName(String name) throws ParameterNull
      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

      List<Player> selectWhereTeamId(long teamId) throws ParameterNull
      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

      int insert(Player player) throws ParameterNull, AlreadyExistsPlayer
      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 throw
      AlreadyExistsPlayer - in case of the new player introduced already exists a exeception will be throw
    • update

      int update(Player player) throws ParameterNull
      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

      int delete(Player player) throws ParameterNull
      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