|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.opencms.db.CmsDbContext
org.opencms.db.jpa.CmsDbContext
public final class CmsDbContext
Wraps context information to access the OpenCms database.
| Field Summary | |
|---|---|
protected javax.persistence.EntityManager |
m_entityManager
The EntityManager instance for this context. |
protected boolean |
m_shouldCommit
Tells when the current transaction should be commit or rollback. |
| Fields inherited from class org.opencms.db.CmsDbContext |
|---|
m_attributes, m_flexRequestContextInfo, m_projectId, m_requestContext |
| Constructor Summary | |
|---|---|
CmsDbContext()
Creates a new, empty database context. |
|
CmsDbContext(CmsRequestContext context)
Creates a new database context initialized with the given user request context. |
|
| Method Summary | |
|---|---|
void |
clear()
Clears this database context. |
javax.persistence.EntityManager |
getEntityManager()
Returns the entity manager of this db context. |
void |
report(I_CmsReport report,
CmsMessageContainer message,
Throwable throwable)
Reports an error to the given report (if available) and to the OpenCms log file. |
void |
rollback()
Rollback current transaction and starts new. |
| Methods inherited from class org.opencms.db.CmsDbContext |
|---|
currentProject, currentUser, getAttribute, getFlexRequestContextInfo, getHistoryDriver, getProjectDriver, getProjectId, getRequestContext, getUserDriver, getVfsDriver, isDefaultDbContext, pop, removeAttribute, removeSiteRoot, setAttribute, setProjectId, throwException |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected javax.persistence.EntityManager m_entityManager
protected boolean m_shouldCommit
| Constructor Detail |
|---|
public CmsDbContext()
public CmsDbContext(CmsRequestContext context)
context - the current users request context| Method Detail |
|---|
public void clear()
clear in class CmsDbContextpublic javax.persistence.EntityManager getEntityManager()
public void report(I_CmsReport report,
CmsMessageContainer message,
Throwable throwable)
throws CmsVfsException,
CmsException
report in class CmsDbContextreport - the report to write the error tomessage - the message to write to the report / logthrowable - the exception to write to the report / log
CmsException - if the throwable parameter is not null and a CmsException
CmsVfsException - if the throwable parameter is not null and no CmsExceptionpublic void rollback()
rollback in class CmsDbContext
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||