T - Type of entityID - ID type for the entity.public interface GenericDAO<T,ID>
| Modifier and Type | Method and Description |
|---|---|
void |
delete(T entity)
Delete the specified object from the persistent store.
|
void |
deleteById(ID id)
Delete an object from the persistent store based on the id.
|
void |
deleteByIds(ID... ids)
Delete objects from the persistent store based on the passed in id values.
|
Iterable<T> |
findAll()
Find all objects of type T.
|
T |
findById(ID id)
Find an object T with the specified id.
|
Iterable<T> |
findByIds(ID... ids)
Find objects of type T with the specified ids.
|
void |
flush()
If the implementation supports lazy writes, manually flush changes to the external database
|
<U extends T> |
getUpdateObject()
Get an object that can be used to capture a set of changes to be applied to one ore more
persisted objects.
|
void |
save(T entity)
Call save to insert a new object into the persistent store or update a preexisting object that has
been modified.
|
<U extends T> |
updateById(U updateObject,
ID id)
Apply the set of changes described in the update object to the persisted item with the
specified id.
|
<U extends T> |
updateByIds(U updateObject,
ID... ids)
Apply the set of changes described in the update object to persisted items with the
specified ids.
|
T findById(ID id) throws NoSuchItemException, JeppettoException
id - of the desired object.NoSuchItemException - if the object identified by the id is not foundJeppettoException - if any other failure occursIterable<T> findByIds(ID... ids) throws JeppettoException
ids - of the desired object.JeppettoException - if any other failure occursIterable<T> findAll() throws JeppettoException
JeppettoException - if any underlying failure occursvoid save(T entity) throws OptimisticLockException, JeppettoException
entity - to save.OptimisticLockException - if optimistic locking is enabled and a save is attempted on an already
modified object.JeppettoException - if any other failure occursvoid delete(T entity) throws JeppettoException
entity - to delete.JeppettoException - if any underlying failure occursvoid deleteById(ID id) throws JeppettoException
id - of the object to delete.JeppettoException - if any underlying failure occursvoid deleteByIds(ID... ids) throws FailedBatchException, JeppettoException
ids - of the objects to delete.FailedBatchException - if some (or all) of the ids were not successfully deleted. The exception
contains a list of the ids that failed to delete.JeppettoException - if any underlying failure occurs<U extends T> U getUpdateObject()
JeppettoException - if any underlying failure occurs<U extends T> T updateById(U updateObject, ID id) throws JeppettoException
updateObject - that describes the set of changes to be applied.id - of the object to update.JeppettoException - if any underlying failure occurs<U extends T> Iterable<T> updateByIds(U updateObject, ID... ids) throws FailedBatchException, JeppettoException
updateObject - that describes the set of changes to be applied.ids - of the objects to update.FailedBatchException - if some (or all) of the referenced items were not successfully updated.
The exception contains a list of the ids that failed to update.JeppettoException - if any underlying failure occursvoid flush()
throws JeppettoException
JeppettoException - if any underlying failure occursCopyright © 2014. All Rights Reserved.