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