T - the entity class related to this DAO.K - the type of the field that represents the entity class' primary key.public interface WriteableDAO<T,K extends Serializable>
| Modifier and Type | Method and Description |
|---|---|
void |
delete(K id)
Removes an object given its primary key.
|
void |
delete(T object)
Removes an object.
|
void |
evict(T object)
Removes an object from the current persistence context.
|
boolean |
isPersistent(T object)
Tells whether a given object is already persistent or not.
|
void |
save(T object)
Saves (inserts) an object.
|
T |
update(T object)
Updates an object.
|
void delete(T object)
object - a T.void delete(K id)
id - a K.void save(T object)
object - a T.T update(T object)
IllegalArgumentException is
thrown. The return value must be the object that is attached to the persistence
context of the underlying implementation, if it exists. Otherwise, this method
simply returns the object passed as a parameter. This return value was added
to deal ORM frameworks like JPA, that do not attach the updated object
to the persistence context. See EntityManager.merge().object - a T.T.IllegalArgumentException - if object is null or not persistent.void evict(T object)
object - a T.boolean isPersistent(T object)
boolean.Copyright © 2008-2013 Ars Machina Tecnologia da Informação Ltda.. All Rights Reserved.