|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.anasoft.os.daofusion.BaseHibernateDataAccessor
public abstract class BaseHibernateDataAccessor
Base class for persistent entity DAO implementations providing data access through JPA / Hibernate persistence APIs.
Persistable
Constructor Summary | |
---|---|
BaseHibernateDataAccessor()
|
Method Summary | |
---|---|
protected org.hibernate.Criteria |
getCriteria(PersistentEntityCriteria entityCriteria,
java.lang.Class<? extends Persistable<? extends java.io.Serializable>> entityClass)
Returns the Criteria instance corresponding to query
constraints defined within the entityCriteria. |
protected org.hibernate.Criteria |
getHibernateCriteria(java.lang.Class<? extends Persistable<? extends java.io.Serializable>> entityClass)
Convenience method for retrieving a new Criteria
instance bound to the current Session . |
protected abstract org.hibernate.ejb.HibernateEntityManager |
getHibernateEntityManager()
Returns an open HibernateEntityManager instance
providing access to the Hibernate Session . |
protected org.hibernate.Session |
getSession()
Convenience method for retrieving the current Session
from the entity manager. |
protected int |
rowCount(org.hibernate.Criteria criteria)
Convenience method for counting the number of rows returned by the given criteria, based on Hibernate rowCount
projection. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BaseHibernateDataAccessor()
Method Detail |
---|
protected abstract org.hibernate.ejb.HibernateEntityManager getHibernateEntityManager()
HibernateEntityManager
instance
providing access to the Hibernate Session
.
The most convenient method implementation pattern is to rely
on entity manager instance injection via the PersistenceContext
annotation within a JPA persistence context. Alternatively,
the entity manager instance can be created directly via the
EntityManagerFactory
.
HibernateEntityManager
instance.protected final org.hibernate.Session getSession()
Session
from the entity manager.
Session
obtained from the entity manager.protected final org.hibernate.Criteria getHibernateCriteria(java.lang.Class<? extends Persistable<? extends java.io.Serializable>> entityClass)
Criteria
instance bound to the current Session
.
entityClass
- Persistent entity class for which
to create the Criteria
instance.
Criteria
instance obtained from
the session.protected final int rowCount(org.hibernate.Criteria criteria)
rowCount
projection.
Note that the criteria shouldn't contain any paging constraints since the method relies on a result set with its "shape" defined by the projection itself.
criteria
- Criteria
instance for which
to perform the row count.
protected org.hibernate.Criteria getCriteria(PersistentEntityCriteria entityCriteria, java.lang.Class<? extends Persistable<? extends java.io.Serializable>> entityClass)
Criteria
instance corresponding to query
constraints defined within the entityCriteria.
entityCriteria
- PersistentEntityCriteria
instance defining persistent entity query constraints.entityClass
- Persistent entity class for which
to create the Criteria
instance.
Criteria
instance corresponding to query
constraints.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |