|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcz.muni.fi.pclis.commons.service.GenericServiceImpl<Dom,Dao>
@Transactional public class GenericServiceImpl<Dom extends DomainObject,Dao extends GenericDao<Dom>>
Simple Generic implementation of GenericService
using some implementation of GenericDao
User: Ľuboš Pecho
Date: 11.8.2009
Time: 13:15:11
Field Summary | |
---|---|
private Dao |
dao
dao object |
private Class<Dom> |
persistentClass
Entity class |
Constructor Summary | |
---|---|
GenericServiceImpl(Class<Dom> persistentClass)
Constructs new service |
Method Summary | |
---|---|
protected void |
assertConfigured()
|
Dom |
create(Dom entity)
persists the entity |
List<Dom> |
getAll()
returns all entities |
Dom |
getById(long id)
get the entity with given id |
Dao |
getDao()
returns the dao |
Dom |
refresh(Dom entity)
refreshes the entity from database |
void |
remove(Dom entity)
removes a persisted entity |
void |
removeById(long id)
removes entity with given id |
Dom |
searchById(long id)
searches the entity with given id |
void |
setDao(Dao dao)
sets the dao |
Dom |
update(Dom entity)
updates the entity |
Dao |
useDao()
tries to use dao |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private Class<Dom extends DomainObject> persistentClass
private Dao extends GenericDao<Dom> dao
Constructor Detail |
---|
public GenericServiceImpl(Class<Dom> persistentClass)
persistentClass
- Method Detail |
---|
public Dom getById(long id)
getById
in interface GenericService<Dom extends DomainObject>
public Dom searchById(long id)
searchById
in interface GenericService<Dom extends DomainObject>
public List<Dom> getAll()
getAll
in interface GenericService<Dom extends DomainObject>
public Dom create(Dom entity)
create
in interface GenericService<Dom extends DomainObject>
public Dom update(Dom entity)
update
in interface GenericService<Dom extends DomainObject>
public void remove(Dom entity)
remove
in interface GenericService<Dom extends DomainObject>
public void removeById(long id)
removeById
in interface GenericService<Dom extends DomainObject>
public Dom refresh(Dom entity)
refresh
in interface GenericService<Dom extends DomainObject>
protected void assertConfigured()
IllegalStateException
- if dao is not setpublic Dao useDao()
public Dao getDao()
public void setDao(Dao dao)
dao
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |