T - the entity class related to this controller.K - the type of the field that represents the entity class' primary key.public interface WriteableController<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 |
saveOrUpdate(T object)
Saves (inserts) or updates 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 TT 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.T saveOrUpdate(T object)
EntityManager.merge().object - a TT.IllegalArgumentException - if object is null.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.