Interface SiteDao


public interface SiteDao
Interface describing the operations allowed on sites in database.
Author:
andresbustamante
  • Method Summary

    Modifier and Type
    Method
    Description
    net.andresbustamante.yafoot.core.model.Site
    Loads a site by its technical ID.
    List<net.andresbustamante.yafoot.core.model.Site>
    findSitesByPlayer(net.andresbustamante.yafoot.core.model.Player player)
    Looks for the sites related to a player.
    int
    saveSite(net.andresbustamante.yafoot.core.model.Site site, net.andresbustamante.yafoot.core.model.Player author)
    Creates a site in database.
  • Method Details

    • findSitesByPlayer

      List<net.andresbustamante.yafoot.core.model.Site> findSitesByPlayer(@Param("player") net.andresbustamante.yafoot.core.model.Player player)
      Looks for the sites related to a player. It will look in player's history to get the sites where the player has played or is planning to go to.
      Parameters:
      player - Player to use for the research
      Returns:
      List of sites found for the player
    • findSiteById

      net.andresbustamante.yafoot.core.model.Site findSiteById(@Param("id") Integer id)
      Loads a site by its technical ID.
      Parameters:
      id - Identifier to search
      Returns:
      Site identified by the number used as parameter for this method
    • saveSite

      int saveSite(@Param("site") net.andresbustamante.yafoot.core.model.Site site, @Param("player") net.andresbustamante.yafoot.core.model.Player author)
      Creates a site in database.
      Parameters:
      site - Site to create
      author - Player creating the site
      Returns:
      Number of created sites. It should be 0 or 1