Package com.xpn.xwiki.store
Class XWikiHibernateVersioningStore
- java.lang.Object
-
- com.xpn.xwiki.internal.store.AbstractXWikiStore
-
- com.xpn.xwiki.store.XWikiHibernateBaseStore
-
- com.xpn.xwiki.store.XWikiHibernateVersioningStore
-
- All Implemented Interfaces:
XWikiVersioningStoreInterface
@Component @Named("hibernate") @Singleton public class XWikiHibernateVersioningStore extends XWikiHibernateBaseStore implements XWikiVersioningStoreInterface
Realization ofXWikiVersioningStoreInterface
for Hibernate-based storage.- Version:
- $Id: 28fb9802d1e919384e753d19dab72f73757feb8e $
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.xpn.xwiki.store.XWikiHibernateBaseStore
XWikiHibernateBaseStore.HibernateCallback<T>
-
-
Field Summary
-
Fields inherited from class com.xpn.xwiki.store.XWikiHibernateBaseStore
hibernateConfiguration, HINT, loggerManager, store
-
-
Constructor Summary
Constructors Constructor Description XWikiHibernateVersioningStore()
Empty constructor needed for component manager.XWikiHibernateVersioningStore(XWikiContext context)
Deprecated.1.6M1.XWikiHibernateVersioningStore(XWiki xwiki, XWikiContext context)
Deprecated.1.6M1.XWikiHibernateVersioningStore(String hibpath)
Deprecated.1.6M1.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deleteArchive(XWikiDocument doc, boolean bTransaction, XWikiContext context)
Delete all history for a document.XWikiDocumentArchive
getXWikiDocumentArchive(XWikiDocument doc, XWikiContext inputxcontext)
org.suigeneris.jrcs.rcs.Version[]
getXWikiDocVersions(XWikiDocument doc, XWikiContext context)
protected List<XWikiRCSNodeInfo>
loadAllRCSNodeInfo(XWikiContext context, long id, boolean bTransaction)
XWikiRCSNodeContent
loadRCSNodeContent(XWikiRCSNodeId id, boolean bTransaction, XWikiContext context)
LoadXWikiRCSNodeContent
on demand.XWikiDocument
loadXWikiDoc(XWikiDocument basedoc, String sversion, XWikiContext inputxcontext)
void
loadXWikiDocArchive(XWikiDocumentArchive archivedoc, boolean bTransaction, XWikiContext context)
void
resetRCSArchive(XWikiDocument doc, boolean bTransaction, XWikiContext inputxcontext)
void
saveXWikiDocArchive(XWikiDocumentArchive archivedoc, boolean bTransaction, XWikiContext context)
void
updateXWikiDocArchive(XWikiDocument doc, boolean bTransaction, XWikiContext inputxcontext)
-
Methods inherited from class com.xpn.xwiki.store.XWikiHibernateBaseStore
beginTransaction, beginTransaction, beginTransaction, beginTransaction, checkHibernate, cleanUp, createHibernateSequenceIfRequired, dynamicMappingTableName, endTransaction, endTransaction, escapeSchema, execute, execute, executeRead, executeRead, executeWrite, executeWrite, failSafeExecute, failSafeExecuteRead, failSafeExecuteWrite, getConfiguration, getConnections, getDatabaseMetaData, getDatabaseProductName, getDatabaseProductName, getDialect, getExecution, getHint, getMapping, getMetadata, getNbConnections, getPath, getSchemaFromWikiName, getSchemaFromWikiName, getSchemaFromWikiName, getSchemaUpdateScript, getSession, getSessionFactory, getTransaction, isInSchemaMode, isVirtual, makeMapping, setDatabase, setNbConnections, setPath, setSession, setSessionFactory, setTransaction, shutdownHibernate, updateSchema, updateSchema, updateSchema, updateSchema
-
-
-
-
Constructor Detail
-
XWikiHibernateVersioningStore
@Deprecated public XWikiHibernateVersioningStore(XWiki xwiki, XWikiContext context)
Deprecated.1.6M1. use ComponentManager.lookup(XWikiVersioningStoreInterface.class) instead.This allows to initialize our storage engine. The hibernate config file path is taken from xwiki.cfg or directly in the WEB-INF directory.- Parameters:
xwiki
- The xwiki objectcontext
- The current context
-
XWikiHibernateVersioningStore
@Deprecated public XWikiHibernateVersioningStore(String hibpath)
Deprecated.1.6M1. use ComponentManager.lookup(XWikiVersioningStoreInterface.class) instead.Initialize the storage engine with a specific path This is used for tests.- Parameters:
hibpath
- path to hibernate.hbm.xml file
-
XWikiHibernateVersioningStore
@Deprecated public XWikiHibernateVersioningStore(XWikiContext context)
Deprecated.1.6M1. use ComponentManager.lookup(XWikiVersioningStoreInterface.class) instead.- Parameters:
context
- The current context- See Also:
XWikiHibernateVersioningStore(XWiki, XWikiContext)
-
XWikiHibernateVersioningStore
public XWikiHibernateVersioningStore()
Empty constructor needed for component manager.
-
-
Method Detail
-
getXWikiDocVersions
public org.suigeneris.jrcs.rcs.Version[] getXWikiDocVersions(XWikiDocument doc, XWikiContext context) throws XWikiException
- Specified by:
getXWikiDocVersions
in interfaceXWikiVersioningStoreInterface
- Throws:
XWikiException
-
getXWikiDocumentArchive
public XWikiDocumentArchive getXWikiDocumentArchive(XWikiDocument doc, XWikiContext inputxcontext) throws XWikiException
- Specified by:
getXWikiDocumentArchive
in interfaceXWikiVersioningStoreInterface
- Throws:
XWikiException
-
loadXWikiDocArchive
public void loadXWikiDocArchive(XWikiDocumentArchive archivedoc, boolean bTransaction, XWikiContext context) throws XWikiException
- Specified by:
loadXWikiDocArchive
in interfaceXWikiVersioningStoreInterface
- Throws:
XWikiException
-
saveXWikiDocArchive
public void saveXWikiDocArchive(XWikiDocumentArchive archivedoc, boolean bTransaction, XWikiContext context) throws XWikiException
- Specified by:
saveXWikiDocArchive
in interfaceXWikiVersioningStoreInterface
- Throws:
XWikiException
-
loadXWikiDoc
public XWikiDocument loadXWikiDoc(XWikiDocument basedoc, String sversion, XWikiContext inputxcontext) throws XWikiException
- Specified by:
loadXWikiDoc
in interfaceXWikiVersioningStoreInterface
- Throws:
XWikiException
-
resetRCSArchive
public void resetRCSArchive(XWikiDocument doc, boolean bTransaction, XWikiContext inputxcontext) throws XWikiException
- Specified by:
resetRCSArchive
in interfaceXWikiVersioningStoreInterface
- Throws:
XWikiException
-
updateXWikiDocArchive
public void updateXWikiDocArchive(XWikiDocument doc, boolean bTransaction, XWikiContext inputxcontext) throws XWikiException
- Specified by:
updateXWikiDocArchive
in interfaceXWikiVersioningStoreInterface
- Throws:
XWikiException
-
loadAllRCSNodeInfo
protected List<XWikiRCSNodeInfo> loadAllRCSNodeInfo(XWikiContext context, long id, boolean bTransaction) throws XWikiException
- Parameters:
context
- the XWiki contextid
-XWikiRCSNodeContent.getId()
bTransaction
- should store to use old transaction(false) or create new (true)- Returns:
- loaded rcs node content
- Throws:
XWikiException
- if any error
-
loadRCSNodeContent
public XWikiRCSNodeContent loadRCSNodeContent(XWikiRCSNodeId id, boolean bTransaction, XWikiContext context) throws XWikiException
Description copied from interface:XWikiVersioningStoreInterface
LoadXWikiRCSNodeContent
on demand. Used inXWikiRCSNodeInfo.getContent(XWikiContext)
for example.- Specified by:
loadRCSNodeContent
in interfaceXWikiVersioningStoreInterface
- Parameters:
id
- the node id (seeXWikiRCSNodeContent.getId()
)- Returns:
- the RCS node content for the passed node id
- Throws:
XWikiException
-
deleteArchive
public void deleteArchive(XWikiDocument doc, boolean bTransaction, XWikiContext context) throws XWikiException
Description copied from interface:XWikiVersioningStoreInterface
Delete all history for a document.- Specified by:
deleteArchive
in interfaceXWikiVersioningStoreInterface
- Parameters:
doc
- the document for which to delete all the history- Throws:
XWikiException
-
-