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(java.lang.Object object)
Add the specified object as a new entry in the datastore.
|
boolean |
createOrUpdate(java.lang.Object object)
If the id of the object is null or zero, create, otherwise update.
|
boolean |
deleteById(java.lang.Class<?> klass,
java.io.Serializable id)
Remove the object with the specified id and class from the datastore.
|
boolean |
deleteEntity(java.lang.Object object)
Remove the specified object from the datastore.
|
<T> T |
fetch(java.lang.Class<T> klass,
java.io.Serializable id)
Get the object with the specified id and class from the datastore.
|
<T> java.util.List<T> |
fetchAll(java.lang.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(java.lang.Object example)
Generates a search filter from the given example using default options.
|
Filter |
getFilterFromExample(java.lang.Object 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 |
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 . |
java.lang.Object |
searchUnique(ISearch search)
ISearch for a single result using the given parameters.
|
void |
update(java.lang.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, setSessionFactory
public void create(java.lang.Object object)
GeneralDAO
create
in interface GeneralDAO
public boolean createOrUpdate(java.lang.Object object)
GeneralDAO
createOrUpdate
in interface GeneralDAO
true
if create; false
if update.public boolean deleteById(java.lang.Class<?> klass, java.io.Serializable id)
GeneralDAO
deleteById
in interface GeneralDAO
true
if the object is found in the datastore and
removed, false
if the item is not found.public boolean deleteEntity(java.lang.Object object)
GeneralDAO
deleteEntity
in interface GeneralDAO
true
if the object is found in the datastore and
removed, false
if the item is not found.public <T> T fetch(java.lang.Class<T> klass, java.io.Serializable id)
GeneralDAO
fetch
in interface GeneralDAO
public <T> java.util.List<T> fetchAll(java.lang.Class<T> klass)
GeneralDAO
fetchAll
in interface GeneralDAO
public void update(java.lang.Object object)
GeneralDAO
update
in interface GeneralDAO
public java.util.List search(ISearch search)
GeneralDAO
ISearch
object.search
in interface GeneralDAO
public int count(ISearch search)
GeneralDAO
ISearch
if there were no paging or maxResult limits.count
in interface GeneralDAO
public SearchResult searchAndCount(ISearch search)
GeneralDAO
SearchResult
object that includes the list of
results like search()
and the total length like
searchLength
.searchAndCount
in interface GeneralDAO
public void flush()
GeneralDAO
flush
in interface GeneralDAO
public boolean isConnected(java.lang.Object object)
GeneralDAO
isConnected
in interface GeneralDAO
public java.lang.Object searchUnique(ISearch search) throws org.hibernate.NonUniqueResultException
GeneralDAO
searchUnique
in interface GeneralDAO
org.hibernate.NonUniqueResultException
public void refresh(java.lang.Object object)
GeneralDAO
refresh
in interface GeneralDAO
public Filter getFilterFromExample(java.lang.Object example)
GeneralDAO
getFilterFromExample
in interface GeneralDAO
public Filter getFilterFromExample(java.lang.Object example, ExampleOptions options)
GeneralDAO
getFilterFromExample
in interface GeneralDAO