Package org.powertac.visualizer.service
Class GameService
- java.lang.Object
-
- org.powertac.visualizer.service.GameService
-
@Service @Transactional public class GameService extends Object
Service Implementation for managing Game.
-
-
Constructor Summary
Constructors Constructor Description GameService(GameRepository gameRepository, FileService fileService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddelete(Game game)Delete the game.org.springframework.data.domain.Page<Game>findAll(org.springframework.data.domain.Pageable pageable)Get all the games.List<Game>findByAssociatedFile(File file)List<Game>findByNameAndType(String login, String name, GameType type)Get one game by login, name and type.List<Game>findByOwnerIsCurrentUserOrShared(String login)Get all the games owned by this user, plus all shared games.Optional<Game>findOne(Long id)Get one game by id.Gamesave(Game game)Save a game.
-
-
-
Constructor Detail
-
GameService
public GameService(GameRepository gameRepository, FileService fileService)
-
-
Method Detail
-
save
public Game save(Game game)
Save a game.- Parameters:
game- the entity to save- Returns:
- the persisted entity
-
findAll
@Transactional(readOnly=true) public org.springframework.data.domain.Page<Game> findAll(org.springframework.data.domain.Pageable pageable)
Get all the games.- Parameters:
pageable- the pagination information- Returns:
- the list of entities
-
findByOwnerIsCurrentUserOrShared
@Transactional(readOnly=true) public List<Game> findByOwnerIsCurrentUserOrShared(String login)
Get all the games owned by this user, plus all shared games.- Returns:
- the list of entities
-
findByNameAndType
@Transactional(readOnly=true) public List<Game> findByNameAndType(String login, String name, GameType type)
Get one game by login, name and type.- Parameters:
login-name-type-- Returns:
- the entity
-
findOne
@Transactional(readOnly=true) public Optional<Game> findOne(Long id)
Get one game by id.- Parameters:
id- the id of the entity- Returns:
- the entity
-
findByAssociatedFile
@Transactional(readOnly=true) public List<Game> findByAssociatedFile(File file)
-
delete
public void delete(Game game)
Delete the game.- Parameters:
game- the Game to delete
-
-