public interface UnitDao
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears the session, ie. remove all entities from memory cache.
|
void |
delete(Object object)
Deletes an entity from database.
|
void |
deleteAll(Class clazz)
Deletes all entities of given mapping.
|
void |
execute(String sqlQuery)
Executes a SQL query against the database.
|
void |
flush()
Flushes the session, ie. synchronize the underlying database with persistable state held in memory.
|
void |
flushAndClear()
Flushes and clears the session.
|
<T> List<T> |
getAll(Class<T> clazz)
Returns a list of stored entities.
|
Set<String> |
getKnownMappings()
Gets Hibernate's known mappings.
|
<T> T |
getOne(Class<T> clazz,
Serializable id)
Returns one stored entity.
|
org.hibernate.Session |
getSession()
Returns the currently used session.
|
org.hibernate.SessionFactory |
getSessionFactory()
Returns the current session factory
|
boolean |
isSessionOpen()
Returns
true if the session is open. |
void |
save(Object object)
Saves an entitity to database.
|
void |
setSession(org.hibernate.Session session)
Sets the session to use.
|
<T> List<T> getAll(Class<T> clazz)
clazz - the mapping's class.<T> T getOne(Class<T> clazz, Serializable id)
clazz - the mapping's class.id - the entity's id value.void save(Object object)
object - the entity to save.void delete(Object object)
object - the entity to delete.void deleteAll(Class clazz)
clazz - the mapping's class.void flush()
Session.clear()void clear()
Session.flush()void setSession(org.hibernate.Session session)
session - the session to use.org.hibernate.Session getSession()
boolean isSessionOpen()
true if the session is open.true if the session is open.org.hibernate.SessionFactory getSessionFactory()
SessionFactorySet<String> getKnownMappings()
void execute(String sqlQuery)
sqlQuery - the SQL query to execute.Copyright © 2014. All Rights Reserved.