public interface IDao<T,PK extends Serializable>
IGisDao| Modifier and Type | Method and Description |
|---|---|
long |
count() |
int |
deleteAll()
Delete all the object from the datastore
|
void |
deleteAll(List<T> list)
Delete all the specified object from the datastore
|
boolean |
exists(PK id)
Checks for existence of an object of type T using the id arg.
|
void |
flushAndClear()
Flush all Memory Objects to the database, and clear the L1 cache, of the
current thread-bound Hibernate Session.
|
T |
get(PK id)
Retrieve the Object whith the specified primary key
|
List<T> |
getAll()
Generic method used to get all objects of a particular type.
|
List<T> |
getAllPaginate(int from,
int maxResults)
Returns all object of a particular type (i.e getAllPaginate(2,5) will
return the [2,3,4,5,6] object
|
Class<T> |
getPersistenceClass() |
void |
remove(T o)
remove the object from the datastore
|
T |
save(T o)
Saves the passed object, and returns an attached entity.
|
void |
setFlushMode(org.hibernate.FlushMode flushMode)
Sets the flush mode (i.e. when objects are flushed to the database) of
the current thread-bound session.
|
List<T> getAll()
List<T> getAllPaginate(int from, int maxResults)
from - The first result to return numbered from 1maxResults - The maximum list size to returnorg.hibernate.HibernateException - if thrown by the Hibernate APISQLException - if thrown by JDBC APIvoid flushAndClear()
org.hibernate.HibernateException - that Indicates problems flushing the session or talking
to the databaseT save(T o)
o - The object to saveorg.springframework.dao.DataAccessException - in case of errorsvoid setFlushMode(org.hibernate.FlushMode flushMode)
FlushModeType.AUTO, which lets the
persistence framework handle that issue. However, for performance
reasons, it might be necessary to set it to FlushModeType.COMMIT.
Warning : this sets the default flush mode of the session (either
hibernate Session, JPA EntityManager, or similar) that
is currently bound to the current thread. This means that it has
absolutely no effect if no transaction is currently opened.flushMode - The flush mode To set for this daoorg.hibernate.HibernateException - if thrown by the Hibernate APISQLException - if thrown by JDBC APIvoid remove(T o)
o - The object to removeorg.springframework.dao.DataAccessException - In case of errorsboolean exists(PK id)
id - the id of the entityorg.springframework.dao.DataAccessException - in case of errorsT get(PK id)
id - the primarey keyorg.springframework.dao.DataAccessException - in case of errorslong count()
org.hibernate.HibernateException - if thrown by the Hibernate APISQLException - if thrown by JDBC APIvoid deleteAll(List<T> list)
list - the list of element to deleteorg.springframework.dao.DataAccessException - in case of errorsint deleteAll()
org.springframework.dao.DataAccessException - in case of errorsCopyright © 2015. All rights reserved.