com.xpn.xwiki.store.migration
Class XWikiDBVersion

java.lang.Object
  extended by com.xpn.xwiki.store.migration.XWikiDBVersion
All Implemented Interfaces:
Comparable<XWikiDBVersion>

public class XWikiDBVersion
extends Object
implements Comparable<XWikiDBVersion>

Stores XWiki's data version in the database. Used to find out which migrations to execute based on the current data version in the Database (each migration says which minimal version it requires to execute).

The version scheme in the past was to use the SVN revision number of the commit of the migrator but since we've now moved to Git we're now using an integer matching the current XWiki version and allowing for a range of 1000 migrations. So if you're writing the first migrator for version 5.2 of XWiki then the version will be 52000. If you're writing the 2nd migration for XWiki 5.2 then its version would be 52001, etc.

Version:
$Id: 6372312b9ffe044f6eda06c0807b88995a016f98 $

Constructor Summary
XWikiDBVersion()
          Default constructor.
XWikiDBVersion(int version)
           
 
Method Summary
 int compareTo(XWikiDBVersion o)
           
 int getVersion()
           
 XWikiDBVersion increment()
           
protected  void setVersion(int version)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XWikiDBVersion

public XWikiDBVersion()
Default constructor. It is need for Hibernate.


XWikiDBVersion

public XWikiDBVersion(int version)
Parameters:
version - - data version
Method Detail

getVersion

public int getVersion()
Returns:
data version

setVersion

protected void setVersion(int version)
Parameters:
version - - data version

compareTo

public int compareTo(XWikiDBVersion o)
Specified by:
compareTo in interface Comparable<XWikiDBVersion>

toString

public String toString()
Overrides:
toString in class Object

increment

public XWikiDBVersion increment()
Returns:
next version


Copyright © 2004–2014 XWiki. All rights reserved.