|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.dao.support.DaoSupport
org.springframework.extensions.jcr.support.JcrDaoSupport
public abstract class JcrDaoSupport
Convenient class for accessing Jcr objects.
| Field Summary |
|---|
| Fields inherited from class org.springframework.dao.support.DaoSupport |
|---|
logger |
| Constructor Summary | |
|---|---|
JcrDaoSupport()
|
|
| Method Summary | |
|---|---|
protected void |
checkDaoConfig()
|
protected org.springframework.dao.DataAccessException |
convertJcrAccessException(javax.jcr.RepositoryException ex)
Convert the given JCRException to an appropriate exception from the org.springframework.dao hierarchy. |
protected javax.jcr.Session |
getSession()
Get a JCR Session, either from the current transaction or a new one. |
protected javax.jcr.Session |
getSession(boolean allowCreate)
Get a JCR Session, either from the current transaction or a new one. |
SessionFactory |
getSessionFactory()
Return the Jcr SessionFactory used by this DAO. |
JcrTemplate |
getTemplate()
Return the JcrTemplate for this DAO, pre-initialized with the SessionFactory or set explicitly. |
protected void |
releaseSession(javax.jcr.Session session)
Close the given JCR Session, created via this DAO's SessionFactory, if it isn't bound to the thread. |
void |
setSessionFactory(SessionFactory sessionFactory)
Set the JCR SessionFactory to be used by this DAO. |
void |
setTemplate(JcrTemplate jcrTemplate)
Set the JcrTemplate for this DAO explicitly, as an alternative to specifying a SessionFactory. |
| Methods inherited from class org.springframework.dao.support.DaoSupport |
|---|
afterPropertiesSet, initDao |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JcrDaoSupport()
| Method Detail |
|---|
public final void setSessionFactory(SessionFactory sessionFactory)
#createJcrTemplate,
#setJcrTemplatepublic final SessionFactory getSessionFactory()
public final void setTemplate(JcrTemplate jcrTemplate)
setSessionFactory(org.springframework.extensions.jcr.SessionFactory)public final JcrTemplate getTemplate()
protected final void checkDaoConfig()
checkDaoConfig in class org.springframework.dao.support.DaoSupportprotected final javax.jcr.Session getSession()
org.springframework.dao.DataAccessResourceFailureException - if the Session couldn't be created
java.lang.IllegalStateException - if no thread-bound Session found and allowCreate falseSessionFactoryUtils.getSession(org.springframework.extensions.jcr.SessionFactory, boolean)
protected final javax.jcr.Session getSession(boolean allowCreate)
throws org.springframework.dao.DataAccessResourceFailureException,
java.lang.IllegalStateException
allowCreate - if a non-transactional Session should be created when no
transactional Session can be found for the current thread
org.springframework.dao.DataAccessResourceFailureException - if the Session couldn't be created
java.lang.IllegalStateException - if no thread-bound Session found and allowCreate falseSessionFactoryUtils.getSession(org.springframework.extensions.jcr.SessionFactory, boolean)protected final org.springframework.dao.DataAccessException convertJcrAccessException(javax.jcr.RepositoryException ex)
Delegates to the convertJCRAccessException method of this DAO's JCRTemplate.
ex - JCRException that occured
#setJCRTemplate,
org.springframework.extensions.jcr.JcrTemplate#convertJCRAccessExceptionprotected final void releaseSession(javax.jcr.Session session)
pm - Session to closeorg.springframework.orm.JCR.SessionFactoryUtils#releaseSession
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||