Package org.powertac.visualizer.service
Class GraphService
- java.lang.Object
-
- org.powertac.visualizer.service.GraphService
-
@Service @Transactional public class GraphService extends Object
Service Implementation for managing Graph.
-
-
Constructor Summary
Constructors Constructor Description GraphService(GraphRepository graphRepository)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
delete(Graph graph)
Delete the graph.org.springframework.data.domain.Page<Graph>
findAll(org.springframework.data.domain.Pageable pageable)
Get all the graphs.List<Graph>
findByOwnerIsCurrentUserOrShared(String login)
Get all the graphs owned by this user, plus all shared graphs.Optional<Graph>
findOne(Long id)
Get one graph by id.Graph
save(Graph graph)
Save a graph.
-
-
-
Constructor Detail
-
GraphService
public GraphService(GraphRepository graphRepository)
-
-
Method Detail
-
save
public Graph save(Graph graph)
Save a graph.- Parameters:
graph
- the entity to save- Returns:
- the persisted entity
-
findAll
@Transactional(readOnly=true) public org.springframework.data.domain.Page<Graph> findAll(org.springframework.data.domain.Pageable pageable)
Get all the graphs.- Parameters:
pageable
- the pagination information- Returns:
- the list of entities
-
findByOwnerIsCurrentUserOrShared
@Transactional(readOnly=true) public List<Graph> findByOwnerIsCurrentUserOrShared(String login)
Get all the graphs owned by this user, plus all shared graphs.- Returns:
- the list of entities
-
findOne
@Transactional(readOnly=true) public Optional<Graph> findOne(Long id)
Get one graph by id.- Parameters:
id
- the id of the entity- Returns:
- the entity
-
delete
public void delete(Graph graph)
Delete the graph.- Parameters:
graph
- the Graph to delete
-
-