@RolesAllowed(value={"ADMIN","USER"}) public class TeamService extends Object
| Constructor and Description |
|---|
TeamService() |
| Modifier and Type | Method and Description |
|---|---|
void |
addPlayer(String teamName,
int playerId)
Adds a player in the team
|
es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team |
create(es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team team)
Creates a new team in the database
|
void |
delete(String name)
Logical deletes a team in the database
|
List<es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team> |
findByAdmin(es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.User user)
Gets a List of Teams from the database that are managed by a given user
|
List<es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team> |
findByNameDescription(String name,
String description)
Gets a Team from the database searching by name or description
|
List<es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team> |
findBySport(es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.SportType sport)
Gets a List of Teams from the database of a given sport type
|
es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team |
get(String name)
Gets a Team from the database
|
void |
realDelete(String name)
Deletes a team from the database
|
void |
removePlayer(String teamName,
int playerId)
Removes a player from the team
|
es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team |
update(es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team team)
Updates a team in the database
|
public es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team get(String name)
name - is the name of the team for searchpublic List<es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team> findByNameDescription(String name, String description)
name - name of the Team to searchdescription - description of the Team to searchpublic List<es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team> findByAdmin(es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.User user)
user - a user that manages teamspublic List<es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team> findBySport(es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.SportType sport)
sport - a SportType for search teamspublic es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team create(es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team team)
team - the team to be inserted in the databasejavax.ejb.EJBAccessException - if the team user is not the current user does not have access to
do this action.public es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team update(es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team team)
team - the team to be updated in the databasejavax.ejb.EJBAccessException - if the team user is not the current user does not have access to
do this action.public void delete(String name)
name - the name of the team to be logical deleted from the databasejavax.ejb.EJBAccessException - if the team user is not the current user does not have access to
do this action.public void addPlayer(String teamName, int playerId)
teamName - the name of the team where we want to add the playerplayerId - the player ID of the player we what to add to the teamjavax.ejb.EJBAccessException - if the team user is not the current user does not have access to
do this action.public void removePlayer(String teamName, int playerId)
teamName - the name of the team where we want to remove the playerplayerId - the player ID of the player we what to remove from the teamjavax.ejb.EJBAccessException - if the team user is not the current user does not have access to
do this action.public void realDelete(String name)
name - the bane of the team to delete from databasejavax.ejb.EJBAccessException - if the team user is not the current user does not have access to
do this action.Copyright © 2017. All rights reserved.