public class GeneralDAOImpl extends HibernateBaseDAO implements GeneralDAO
GeneralDAO using Hibernate.
The SessionFactory property is annotated for automatic resource injection.| Constructor and Description |
|---|
GeneralDAOImpl() |
| 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(Object object)
Add the specified object as a new entry in the datastore.
|
boolean |
createOrUpdate(Object object)
If the id of the object is null or zero, create, otherwise update.
|
boolean |
deleteById(Class<?> klass,
Serializable id)
Remove the object with the specified id and class from the datastore.
|
boolean |
deleteEntity(Object object)
Remove the specified object from the datastore.
|
<T> T |
fetch(Class<T> klass,
Serializable id)
Get the object with the specified id and class from the datastore.
|
<T> List<T> |
fetchAll(Class<T> klass)
Get a list of all the objects of the specified type.
|
void |
flush()
Flushes changes in the Hibernate session to the datastore.
|
Filter |
getFilterFromExample(Object example)
Generates a search filter from the given example using default options.
|
Filter |
getFilterFromExample(Object example,
ExampleOptions options)
Generates a search filter from the given example using the specified options.
|
boolean |
isConnected(Object object)
Returns true if the object is connected to the current Hibernate session.
|
void |
refresh(Object object)
Refresh the content of the given entity from the current datastore state.
|
List |
search(ISearch search)
Search for objects given the search parameters in the specified
ISearch object. |
SearchResult |
searchAndCount(ISearch search)
Returns a
SearchResult object that includes the list of
results like search() and the total length like
searchLength. |
Object |
searchUnique(ISearch search)
ISearch for a single result using the given parameters.
|
void |
update(Object object)
Update the corresponding object in the datastore with the properties of
the specified object.
|
_all, _count, _count, _count, _deleteById, _deleteById, _deleteEntities, _deleteEntity, _exists, _exists, _exists, _flush, _get, _get, _getFilterFromExample, _getFilterFromExample, _load, _load, _load, _merge, _persist, _refresh, _save, _save, _saveOrUpdate, _saveOrUpdateIsNew, _saveOrUpdateIsNew, _search, _search, _searchAndCount, _searchAndCount, _searchUnique, _searchUnique, _sessionContains, _update, getMetadataUtil, getSearchProcessor, getSession, getSessionFactory, setSessionFactorypublic void create(Object object)
GeneralDAOcreate in interface GeneralDAOpublic boolean createOrUpdate(Object object)
GeneralDAOcreateOrUpdate in interface GeneralDAOtrue if create; false if update.public boolean deleteById(Class<?> klass, Serializable id)
GeneralDAOdeleteById in interface GeneralDAOtrue if the object is found in the datastore and
removed, false if the item is not found.public boolean deleteEntity(Object object)
GeneralDAOdeleteEntity in interface GeneralDAOtrue if the object is found in the datastore and
removed, false if the item is not found.public <T> T fetch(Class<T> klass, Serializable id)
GeneralDAOfetch in interface GeneralDAOpublic <T> List<T> fetchAll(Class<T> klass)
GeneralDAOfetchAll in interface GeneralDAOpublic void update(Object object)
GeneralDAOupdate in interface GeneralDAOpublic List search(ISearch search)
GeneralDAOISearch object.search in interface GeneralDAOpublic int count(ISearch search)
GeneralDAOISearch if there were no paging or maxResult limits.count in interface GeneralDAOpublic SearchResult searchAndCount(ISearch search)
GeneralDAOSearchResult object that includes the list of
results like search() and the total length like
searchLength.searchAndCount in interface GeneralDAOpublic void flush()
GeneralDAOflush in interface GeneralDAOpublic boolean isConnected(Object object)
GeneralDAOisConnected in interface GeneralDAOpublic Object searchUnique(ISearch search) throws org.hibernate.NonUniqueResultException
GeneralDAOsearchUnique in interface GeneralDAOorg.hibernate.NonUniqueResultExceptionpublic void refresh(Object object)
GeneralDAOrefresh in interface GeneralDAOpublic Filter getFilterFromExample(Object example)
GeneralDAOgetFilterFromExample in interface GeneralDAOpublic Filter getFilterFromExample(Object example, ExampleOptions options)
GeneralDAOgetFilterFromExample in interface GeneralDAOCopyright © 2008-2013. All Rights Reserved.