|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.derquinsej.hib3.AbstractDAOImpl
public abstract class AbstractDAOImpl
Abstract implementation for general and generic DAO.
| Constructor Summary | |
|---|---|
AbstractDAOImpl()
Constructs the DAO |
|
AbstractDAOImpl(org.hibernate.SessionFactory sessionFactory)
Constructs the DAO |
|
| Method Summary | ||
|---|---|---|
void |
clear()
Clears the session cache. |
|
protected void |
evict(Object object)
Remove the provided instance from the session cache. |
|
protected
|
first(Class<T> type,
org.hibernate.Query query)
Returns the first result of a query returning instances of a specified class. |
|
void |
flush()
Flushes the session. |
|
protected org.hibernate.Query |
getNamedQuery(String queryName)
Returns a externally defined named query. |
|
protected org.hibernate.Session |
getSession()
Returns the current session. |
|
protected
|
list(Class<T> type,
org.hibernate.Query query)
Returns the results of a query as a list of a specified class. |
|
protected
|
list(Class<T> type,
String queryName,
Object value)
Returns the results of a named query with a single parameter as a list of a specified class. |
|
void |
setSessionFactory(org.hibernate.SessionFactory sessionFactory)
Sets the session factory to use. |
|
void |
sync()
Flushes the session and clears the session cache. |
|
protected
|
unique(Class<T> type,
org.hibernate.Query query)
Returns the unique result of a query returning instances of a specified class. |
|
protected
|
unique(Class<T> type,
String queryName,
Object value)
Returns the unique result of a named query with a single parameter returning instances of a specified class. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractDAOImpl(org.hibernate.SessionFactory sessionFactory)
sessionFactory - Hibernate Session factory.public AbstractDAOImpl()
| Method Detail |
|---|
public void setSessionFactory(org.hibernate.SessionFactory sessionFactory)
sessionFactory - Hibernate session factory.protected final org.hibernate.Session getSession()
public void clear()
DAO
clear in interface DAOpublic void flush()
DAO
flush in interface DAOpublic void sync()
DAO
sync in interface DAOprotected void evict(Object object)
object - The persistent instance to remove.protected org.hibernate.Query getNamedQuery(String queryName)
queryName - Query name.
protected <T> List<T> list(Class<T> type,
org.hibernate.Query query)
type - Entity type.query - Query to execute.
protected <T> T first(Class<T> type,
org.hibernate.Query query)
type - Entity type.query - Query to execute.
null if there are no results.
protected <T> T unique(Class<T> type,
org.hibernate.Query query)
type - Entity type.query - Query to execute.
null if there are no results.
org.hibernate.NonUniqueResultException - if there are more than one result.
protected <T> List<T> list(Class<T> type,
String queryName,
Object value)
type - Entity type.queryName - Query name.value - Non-null parameter value.
protected <T> T unique(Class<T> type,
String queryName,
Object value)
type - Entity type.queryName - Query name.value - Non-null parameter value.
null if there are no results.
org.hibernate.NonUniqueResultException - if there are more than one result.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||