T - the entity class related to this controller.K - the type of the field that represents the entity class' primary key.public abstract class ControllerImpl<T,K extends Serializable> extends Object implements Controller<T,K>
Controller interface by delegating all method calls to
a DAO passed through its constructor.| Constructor and Description |
|---|
ControllerImpl(br.com.arsmachina.dao.DAO<T,K> dao)
Single constructor of this class.
|
| Modifier and Type | Method and Description |
|---|---|
long |
countAll()
Invokes
dao.countAll() |
void |
delete(K id)
Invokes
dao.delete() |
void |
delete(T object)
Invokes
dao.delete() |
void |
evict(T object)
Invokes
dao.evict() |
List<T> |
findAll()
Invokes
dao.findAll() |
List<T> |
findAll(int firstResult,
int maxResults,
br.com.arsmachina.dao.SortCriterion... sortCriteria)
Invokes
dao.findAll() |
List<T> |
findByExample(T example)
Invokes
dao.findByExample() |
T |
findById(K id)
Invokes
dao.findById() |
List<T> |
findByIds(K... ids)
Invokes
dao.findByIds() |
boolean |
isPersistent(T object)
Invokes
dao.isPersistent() |
T |
reattach(T object)
Invokes
dao.reattach() |
T |
refresh(T object)
Invokes
dao.refresh() |
void |
save(T object)
Invokes
dao.save() |
T |
saveOrUpdate(T object)
Invokes
save(Object) if the object is persistent and update(Object)
otherwise. |
T |
update(T object)
Invokes
dao.update() |
public long countAll()
dao.countAll().countAll in interface ReadableController<T,K extends Serializable>ReadableControllerImpl.countAll()public List<T> findAll()
dao.findAll().findAll in interface ReadableController<T,K extends Serializable>ReadableControllerImpl.findAll()public List<T> findAll(int firstResult, int maxResults, br.com.arsmachina.dao.SortCriterion... sortCriteria)
dao.findAll().findAll in interface ReadableController<T,K extends Serializable>firstResult - maxResults - sortCriteria - ReadableControllerImpl.findAll(int, int, br.com.arsmachina.dao.SortCriterion[])public List<T> findByExample(T example)
dao.findByExample().findByExample in interface ReadableController<T,K extends Serializable>example - ReadableControllerImpl.findByExample(java.lang.Object)public T findById(K id)
dao.findById().findById in interface ReadableController<T,K extends Serializable>id - ReadableControllerImpl.findById(java.io.Serializable)public List<T> findByIds(K... ids)
dao.findByIds().findByIds in interface ReadableController<T,K extends Serializable>ids - br.com.arsmachina.controller.impl.ReadableControllerImpl#findByIds(K[])public T refresh(T object)
dao.refresh().refresh in interface ReadableController<T,K extends Serializable>object - T, which may or may not be the same object passed in the parameter.ReadableControllerImpl.refresh(java.lang.Object)public void delete(K id)
dao.delete().delete in interface WriteableController<T,K extends Serializable>id - WriteableControllerImpl.delete(java.io.Serializable)public void delete(T object)
dao.delete().delete in interface WriteableController<T,K extends Serializable>object - WriteableControllerImpl.delete(java.lang.Object)public void evict(T object)
dao.evict().evict in interface WriteableController<T,K extends Serializable>object - WriteableControllerImpl.evict(java.lang.Object)public boolean isPersistent(T object)
dao.isPersistent().isPersistent in interface WriteableController<T,K extends Serializable>object - WriteableControllerImpl.isPersistent(java.lang.Object)public void save(T object)
dao.save().save in interface WriteableController<T,K extends Serializable>object - WriteableControllerImpl.save(java.lang.Object)public T saveOrUpdate(T object)
save(Object) if the object is persistent and update(Object)
otherwise. The object is considered persistent if isPersistent(Object) returns
true.saveOrUpdate in interface WriteableController<T,K extends Serializable>object - a T.T.public T update(T object)
dao.update().update in interface WriteableController<T,K extends Serializable>object - T.WriteableControllerImpl.update(java.lang.Object)public T reattach(T object)
dao.reattach().reattach in interface ReadableController<T,K extends Serializable>object - ReadableController.reattach(java.lang.Object)Copyright © 2008-2013 Ars Machina Tecnologia da Informação Ltda.. All Rights Reserved.