The "xwikircs" Table

The xwikircs table corresponds to the com.xpn.xwiki.doc.rcs.XWikiRCSNodeInfo and com.xpn.xwiki.doc.rcs.XWikiRCSNodeContent classes and it stores information about XWiki documents versions. 

To better explain the reason why we need 2 classes, we will take the "History" tab as example. Normally, when displaying the list of available versions, you see information like the version number, the last editor, the date of the last modification and a summary explaining what changed since the last version. In this case, XWiki only needs to load the "XWikiRCSNodeInfo" class. On the other hand, when comparing 2 versions, a diff is displayed, which requires the loading of the second class, "XWikiRCSNodeContent".

The mapping information is available in the xwiki.hbm.xml file:

<class name="com.xpn.xwiki.doc.rcs.XWikiRCSNodeInfo" table="xwikircs">
 <composite-id name="id" class="com.xpn.xwiki.doc.rcs.XWikiRCSNodeId">
   <key-property name="docId" column="XWR_DOCID" type="long" />
   <key-property name="version1" column="XWR_VERSION1" type="integer" />
   <key-property name="version2" column="XWR_VERSION2" type="integer" />
 </composite-id>
 <property name="date" type="timestamp" column="XWR_DATE" index="REV_DATE" not-null="true" />
 <!-- Note: Length must be the same one as XWD_COMMENT since it's the same content being put in history -->
 <property name="comment" type="string" column="XWR_COMMENT" length="1023" not-null="true" />
 <!-- Note: Length must be the same one as XWD_COMMENT since it's the same content being put in history -->
 <property name="author" type="string" column="XWR_AUTHOR" length="255" index="REV_AUTHOR" not-null="true" />
 <property name="diff" type="boolean" column="XWR_ISDIFF" index="REV_ISDIFF" not-null="false" update="false" insert="false" />
</class>

<class name="com.xpn.xwiki.doc.rcs.XWikiRCSNodeContent" table="xwikircs">
 <composite-id name="id" class="com.xpn.xwiki.doc.rcs.XWikiRCSNodeId">
   <key-property name="docId" column="XWR_DOCID" type="long" />
   <key-property name="version1" column="XWR_VERSION1" type="integer" />
   <key-property name="version2" column="XWR_VERSION2" type="integer" />
  </composite-id>
 <component name="patch">
   <property name="diff" type="boolean" column="XWR_ISDIFF" not-null="false" />
   <property name="content" type="materialized_clob" column="XWR_PATCH" not-null="false" length="1000000000" />
 </component>
</class>

The columns of the xwikircs table are:

ColumnData typeClass propertyDefault valuenot-nullIndex
XWR_DOCID (primary key)bigint(20)docId0true-
XWR_VERSION1 (primary key)int(11)version10true-
XWR_VERSION2 (primary key)int(11)version20true-
XWR_DATEdatetimedate0000-00-00 00:00:00trueREV_DATE
XWR_COMMENTvarchar(1023)comment-true-
XWR_AUTHORvarchar(255)author-trueREV_AUTHOR
XWR_ISDIFFbit(1)diff-falseREV_ISDIFF
ColumnData typeClass propertyDefault valuenot-nullIndex
XWR_DOCID (primary key)bigint(20)docId0true-
XWR_VERSION1 (primary key)int(11)version10true-
XWR_VERSION2 (primary key)int(11)version20true-
XWR_ISDIFFbit(1)diff-falseREV_ISDIFF
XWR_PATCHlongtextcontent-false-

   

Related Pages

Trying to decide between Cloud and On Premise? See the comparison on the XWiki Help Center.

Search this space