T
- The type of the domain object for which this instance is to be
used.ID
- The type of the id of the domain object for which this instance is
to be used.public interface GenericDAO<T,ID extends java.io.Serializable>
Modifier and Type | Method and Description |
---|---|
int |
count(ISearch search)
Returns the total number of results that would be returned using the
given
ISearch if there were no paging or maxResult limits. |
void |
create(T object)
Add the specified object as a new entry in the datastore.
|
boolean |
createOrUpdate(T object)
If the id of the object is null or zero, create, otherwise update.
|
boolean |
deleteById(ID id)
Remove the object of this type with the specified id from the datastore.
|
boolean |
deleteEntity(T object)
Remove the specified object from the datastore.
|
T |
fetch(ID id)
Get the object of this type with the specified id from the datastore.
|
java.util.List<T> |
fetchAll()
Get a list of all the objects of this type.
|
void |
flush()
Flushes changes in the Hibernate cache to the datastore.
|
Filter |
getFilterFromExample(T example)
Generates a search filter from the given example using default options.
|
Filter |
getFilterFromExample(T example,
ExampleOptions options)
Generates a search filter from the given example using the specified options.
|
boolean |
isConnected(java.lang.Object object)
Returns true if the object is connected to the current Hibernate session.
|
void |
refresh(java.lang.Object object)
Refresh the content of the given entity from the current datastore state.
|
java.util.List<T> |
search(ISearch search)
Search for objects of this type given the search parameters in the
specified
ISearch object. |
SearchResult<T> |
searchAndCount(ISearch search)
Returns a
SearchResult object that includes the list of
results like search() and the total length like
searchLength . |
java.util.List |
searchGeneric(ISearch search)
Search for objects given the search parameters in the specified
ISearch object. |
java.lang.Object |
searchUnique(ISearch search)
Search for a single result using the given parameters.
|
void |
update(T object)
Update the corresponding object in the datastore with the properties of
the specified object.
|
void create(T object)
boolean createOrUpdate(T object)
true
if create; false
if update.boolean deleteById(ID id)
true
if the object is found in the datastore and
removed, false
if the item is not found.boolean deleteEntity(T object)
true
if the object is found in the datastore and
removed, false
if the item is not found.java.util.List<T> fetchAll()
void update(T object)
java.util.List<T> search(ISearch search)
ISearch
object.int count(ISearch search)
ISearch
if there were no paging or maxResult limits.SearchResult<T> searchAndCount(ISearch search)
SearchResult
object that includes the list of
results like search()
and the total length like
searchLength
.java.util.List searchGeneric(ISearch search)
ISearch
object. Return an untyped result list. The result
type can be determined by fetch mode and fetches on the search.java.lang.Object searchUnique(ISearch search) throws org.hibernate.NonUniqueResultException
org.hibernate.NonUniqueResultException
boolean isConnected(java.lang.Object object)
void flush()
void refresh(java.lang.Object object)
Filter getFilterFromExample(T example)
Filter getFilterFromExample(T example, ExampleOptions options)