|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbr.com.arsmachina.controller.impl.WriteableControllerImpl<T,K>
T - the entity class related to this controller.K - the type of the field that represents the entity class' primary key.public abstract class WriteableControllerImpl<T,K extends Serializable>
Abstract class that implements the WriteableController interface by delegating all method
calls to a WriteableDAO passed through its constructor.
| Constructor Summary | |
|---|---|
WriteableControllerImpl(br.com.arsmachina.dao.WriteableDAO<T,K> dao)
Single constructor of this class. |
|
| Method Summary | |
|---|---|
void |
delete(K id)
Invokes dao.delete() |
void |
delete(T object)
Invokes dao.delete() |
void |
evict(T object)
Invokes dao.evict() |
boolean |
isPersistent(T object)
Invokes dao.isPersistent() |
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() |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WriteableControllerImpl(br.com.arsmachina.dao.WriteableDAO<T,K> dao)
dao - a WriteableDAO. It cannot be null.| Method Detail |
|---|
public boolean isPersistent(T object)
dao.isPersistent().
- Specified by:
isPersistent in interface WriteableController<T,K extends Serializable>
- Parameters:
object -
- Returns:
- See Also:
WriteableDAO.isPersistent(java.lang.Object)
public void delete(K id)
dao.delete().
- Specified by:
delete in interface WriteableController<T,K extends Serializable>
- Parameters:
id - - See Also:
WriteableDAO.delete(java.io.Serializable)
public void delete(T object)
dao.delete().
- Specified by:
delete in interface WriteableController<T,K extends Serializable>
- Parameters:
object - - See Also:
WriteableDAO.delete(java.lang.Object)
public void save(T object)
dao.save().
- Specified by:
save in interface WriteableController<T,K extends Serializable>
- Parameters:
object - - See Also:
WriteableDAO.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().
- Specified by:
update in interface WriteableController<T,K extends Serializable>
- Parameters:
object -
- Returns:
- a
T. - See Also:
WriteableDAO.update(java.lang.Object)
public void evict(T object)
dao.evict().
- Specified by:
evict in interface WriteableController<T,K extends Serializable>
- Parameters:
object - - See Also:
WriteableDAO.evict(java.lang.Object)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||