cz.muni.fi.pclis.commons.service
Interface GenericService<T extends DomainObject>

All Known Subinterfaces:
PeerEvaluationAssignmentService<Ass>, SelfEvaluationAssignmentService, StudentEvaluationAssignmentService, TeamEvaluationAssignmentService
All Known Implementing Classes:
GenericServiceImpl, SelfEvaluationAssignmentServiceImpl, StudentEvaluationAssignmentServiceImpl, TeamEvaluationAssignmentServiceImpl

public interface GenericService<T extends DomainObject>

Generic interface definnig all services User: Ľuboš Pecho Date: 11.8.2009 Time: 13:12:44


Method Summary
 T create(T entity)
          persists the entity
 List<T> getAll()
          returns all entities
 T getById(long id)
          get the entity with given id
 T refresh(T entity)
          refreshes the entity from database
 void remove(T entity)
          removes a persisted entity
 void removeById(long id)
          removes entity with given id
 T searchById(long id)
          searches the entity with given id
 T update(T entity)
          updates the entity
 

Method Detail

getById

T getById(long id)
get the entity with given id

Parameters:
id -
Returns:
entity
Throws:
DomainObjectNotFoundException - if no object is found

searchById

T searchById(long id)
searches the entity with given id

Parameters:
id -
Returns:
entity, null if none is found

getAll

List<T> getAll()
returns all entities

Returns:

create

T create(T entity)
persists the entity

Parameters:
entity -
Returns:

update

T update(T entity)
updates the entity

Parameters:
entity -
Returns:

remove

void remove(T entity)
removes a persisted entity

Parameters:
entity -

refresh

T refresh(T entity)
refreshes the entity from database

Parameters:
entity -
Returns:

removeById

void removeById(long id)
removes entity with given id

Parameters:
id -


Copyright © 2009-2010 Faculty of Informatics, Masaryk university, Brno. All Rights Reserved.