commit f728a51b4c24f02cbf4d3c43e433cf3080fc9b08
Author: Andreas Müller <a.mueller@bgbm.org>
Date:   Sat Apr 16 02:04:52 2016 +0200

    Add base structure for model update to 4.0

diff --git a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/metadata/CdmMetaData.java b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/metadata/CdmMetaData.java
index 9a399c67e6..4223b6e32d 100644
--- a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/metadata/CdmMetaData.java
+++ b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/metadata/CdmMetaData.java
@@ -1,245 +1,246 @@
-// $Id$
-/**
-* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
-* http://www.e-taxonomy.eu
-* 
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
-
-package eu.etaxonomy.cdm.model.metadata;
-
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.List;
-
-import javax.persistence.Entity;
-
-import org.apache.log4j.Logger;
-import org.joda.time.DateTime;
-
-import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
-import eu.etaxonomy.cdm.model.common.CdmBase;
-
-/**
- * @author a.mueller
- * @created 07.09.2009
- */
-@Entity
-public class CdmMetaData extends CdmBase{
-	private static final long serialVersionUID = -3033376680593279078L;
-	@SuppressWarnings("unused")
-	private static final Logger logger = Logger.getLogger(CdmMetaData.class);
-
-	/* It is a little bit confusing that this specific information is located in
-	 * a generic class for metadata. Think about moving the schema version 
-	 *  
-	 */
-	/**
-	 * The database schema version number.
-	 * It is recommended to have the first two numbers equal to the CDM Library version number.
-	 * But it is not obligatory as there may be cases when the library number changes but the
-	 * schema version is not changing.
-	 * The third should be incremented if the schema changes in a way that SCHEMA_VALIDATION.UPDATE
-	 * will probably not work or will not be enough to transform old data into new data.
-	 * The fourth number should be incremented when minor schema changes take place that can
-	 * be handled by SCHEMA_VALIDATION.UPDATE
-	 * The last number represents the date of change.
-	 */
-	private static final String dbSchemaVersion = "3.6.0.0.201527040000";
-//	private static final String dbSchemaVersion = "3.4.1.0.201411210000";
-//	private static final String dbSchemaVersion = "3.5.0.0.201531030000";
-	
-
-	
-	
-
-	/**
-	 * @return a list of default metadata objects 
-	 */
-	public static final List<CdmMetaData> defaultMetaData(){
-		List<CdmMetaData> result = new ArrayList<CdmMetaData>();
-		// schema version
-		result.add(new CdmMetaData(MetaDataPropertyName.DB_SCHEMA_VERSION, dbSchemaVersion));
-		//term version
-		result.add(new CdmMetaData(MetaDataPropertyName.TERMS_VERSION, termsVersion));
-		// database create time
-		result.add(new CdmMetaData(MetaDataPropertyName.DB_CREATE_DATE, new DateTime().toString()));
-		return result;	
-	}
-	
-	/**
-	 * The version number for the terms loaded by the termloader (csv-files)
-	 * It is recommended to have the first two numbers equal to the CDM Library version number.
-	 * 
-	 * But it is not obligatory as there may be cases when the library number changes but the
-	 * schema version is not changing.
-	 * 
-	 * The third should be incremented if the terms change in a way that is not compatible
-	 * to the previous version (e.g. by changing the type of a term)
-	 * 
-	 * The fourth number should be incremented when compatible term changes take place
-	 * (e.g. when new terms were added)
-	 * 
-	 * The last number represents the date of change.
-	 */
-	private static final String termsVersion = "3.6.0.0.201527040000";
-//	private static final String termsVersion = "3.5.0.0.201531030000";
-	
-	
-	public enum MetaDataPropertyName{
-		DB_SCHEMA_VERSION,
-		TERMS_VERSION,
- 		DB_CREATE_DATE,
-		DB_CREATE_NOTE;
-		
-		public String getSqlQuery(){
-			return "SELECT value FROM CdmMetaData WHERE propertyname=" + this.ordinal();
-		}
-	}
-	
-	/* END OF CONFUSION */
-	private MetaDataPropertyName propertyName;
-	private String value;
-
-	
-	/**
-	 * Method to retrieve a CDM Libraries meta data
-	 * @return
-	 */
-	public static final List<CdmMetaData> propertyList(){
-		List<CdmMetaData> result = new ArrayList<CdmMetaData>();
-		result.add(new CdmMetaData(MetaDataPropertyName.DB_SCHEMA_VERSION, dbSchemaVersion));
-		result.add(new CdmMetaData(MetaDataPropertyName.TERMS_VERSION, termsVersion));
-		result.add(new CdmMetaData(MetaDataPropertyName.DB_CREATE_DATE, new DateTime().toString()));
-		return result;
-	}
-
-//********************* Constructor *********************************************/	
-
-	/**
-	 * Simple constructor to be used by Spring
-	 */
-	protected CdmMetaData(){
-		super();
-	}
-
-	public CdmMetaData(MetaDataPropertyName propertyName, String value) {
-		super();
-		this.propertyName = propertyName;
-		this.value = value;
-	}
-
-//****************** instance methods ****************************************/	
-	
-	/**
-	 * @return the propertyName
-	 */
-	public MetaDataPropertyName getPropertyName() {
-		return propertyName;
-	}
-
-	/**
-	 * @param propertyName the propertyName to set
-	 */
-	public void setPropertyName(MetaDataPropertyName propertyName) {
-		this.propertyName = propertyName;
-	}
-
-	/**
-	 * @return the value
-	 */
-	public String getValue() {
-		return value;
-	}
-
-	/**
-	 * @param value the value to set
-	 */
-	public void setValue(String value) {
-		this.value = value;
-	}
-
-//******************** Version comparator **********************************/
-	
-	public static class VersionComparator implements Comparator<String>{
-		Integer depth;
-		IProgressMonitor monitor;
-		
-		public VersionComparator(Integer depth, IProgressMonitor monitor){
-			this.depth = depth;
-			this.monitor = monitor;
-		}
-		
-		/* (non-Javadoc)
-		 * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
-		 */
-		public int compare(String version1, String version2) {
-			int result = 0;
-			String[] version1Split = version1.split("\\.");
-			String[] version2Split = version2.split("\\.");
-			
-			if(version1Split.length == 1 || version2Split.length == 1){
-				throwException("Tried to compare version but given Strings don't seem to " +
-						"contain version numbers. version1: " + version1 + ", version2:" + version2); 
-			}
-			
-			if(depth != null && (version1Split.length < depth || version2Split.length < depth )){
-				throwException("Desired depth can not be achieved with the given strings. depth: " + depth  + ", version1: " + version1 + ", version2:" + version2); 
-			}			
-			
-			int length = (depth == null ||version1Split.length < depth) ? version1Split.length : depth;
-			for (int i = 0; i < length; i++){
-				Long version1Part = Long.valueOf(version1Split[i]);
-				Long version2Part = Long.valueOf(version2Split[i]);
-				int partCompare = version1Part.compareTo(version2Part);
-				if (partCompare != 0){
-					return partCompare;
-				}
-			}
-			return result;
-		}
-		
-		private Throwable throwException(String message){
-			RuntimeException exception =  new RuntimeException(message);
-			if (monitor != null){
-				monitor.warning(message, exception);
-			}
-			throw exception;
-		}
-		
-	}
-
-	/**
-	 * Compares two version string. If version1 is higher than version2 a positive result is returned.
-	 * If both are equal 0 is returned, otherwise -1 is returned.
-	 * @see Comparator#compare(Object, Object)
-	 * @param version1
-	 * @param version2
-	 * @param depth
-	 * @param monitor
-	 * @return
-	 */
-	public static int compareVersion(String version1, String version2, Integer depth, IProgressMonitor monitor){
-		VersionComparator versionComparator = new VersionComparator(depth, monitor);
-		return versionComparator.compare(version1, version2);
-	}
-	
-	public static boolean isDbSchemaVersionCompatible(String version){
-		return compareVersion(dbSchemaVersion, version, 3, null) == 0;
-	}
-
-	public static String getDbSchemaVersion() {
-		return dbSchemaVersion;
-	}
-	
-	public static String getTermsVersion() {
-		return termsVersion;
-	}
-
-	public static boolean isTermsVersionCompatible(String version){
-		return compareVersion(termsVersion, version, 3, null) == 0;
-	}
-	
-}
+// $Id$
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+
+package eu.etaxonomy.cdm.model.metadata;
+
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.List;
+
+import javax.persistence.Entity;
+
+import org.apache.log4j.Logger;
+import org.joda.time.DateTime;
+
+import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
+import eu.etaxonomy.cdm.model.common.CdmBase;
+
+/**
+ * @author a.mueller
+ * @created 07.09.2009
+ */
+@Entity
+public class CdmMetaData extends CdmBase{
+	private static final long serialVersionUID = -3033376680593279078L;
+	@SuppressWarnings("unused")
+	private static final Logger logger = Logger.getLogger(CdmMetaData.class);
+
+	/* It is a little bit confusing that this specific information is located in
+	 * a generic class for metadata. Think about moving the schema version
+	 *
+	 */
+	/**
+	 * The database schema version number.
+	 * It is recommended to have the first two numbers equal to the CDM Library version number.
+	 * But it is not obligatory as there may be cases when the library number changes but the
+	 * schema version is not changing.
+	 * The third should be incremented if the schema changes in a way that SCHEMA_VALIDATION.UPDATE
+	 * will probably not work or will not be enough to transform old data into new data.
+	 * The fourth number should be incremented when minor schema changes take place that can
+	 * be handled by SCHEMA_VALIDATION.UPDATE
+	 * The last number represents the date of change.
+	 */
+//	private static final String dbSchemaVersion = "3.6.0.0.201527040000";
+	private static final String dbSchemaVersion = "4.0.0.0.201604200000";
+//	private static final String dbSchemaVersion = "3.5.0.0.201531030000";
+
+
+
+
+
+	/**
+	 * @return a list of default metadata objects
+	 */
+	public static final List<CdmMetaData> defaultMetaData(){
+		List<CdmMetaData> result = new ArrayList<CdmMetaData>();
+		// schema version
+		result.add(new CdmMetaData(MetaDataPropertyName.DB_SCHEMA_VERSION, dbSchemaVersion));
+		//term version
+		result.add(new CdmMetaData(MetaDataPropertyName.TERMS_VERSION, termsVersion));
+		// database create time
+		result.add(new CdmMetaData(MetaDataPropertyName.DB_CREATE_DATE, new DateTime().toString()));
+		return result;
+	}
+
+	/**
+	 * The version number for the terms loaded by the termloader (csv-files)
+	 * It is recommended to have the first two numbers equal to the CDM Library version number.
+	 *
+	 * But it is not obligatory as there may be cases when the library number changes but the
+	 * schema version is not changing.
+	 *
+	 * The third should be incremented if the terms change in a way that is not compatible
+	 * to the previous version (e.g. by changing the type of a term)
+	 *
+	 * The fourth number should be incremented when compatible term changes take place
+	 * (e.g. when new terms were added)
+	 *
+	 * The last number represents the date of change.
+	 */
+//	private static final String termsVersion = "3.6.0.0.201527040000";
+	private static final String termsVersion = "4.0.0.0.201604200000";
+
+
+	public enum MetaDataPropertyName{
+		DB_SCHEMA_VERSION,
+		TERMS_VERSION,
+ 		DB_CREATE_DATE,
+		DB_CREATE_NOTE;
+
+		public String getSqlQuery(){
+			return "SELECT value FROM CdmMetaData WHERE propertyname=" + this.ordinal();
+		}
+	}
+
+	/* END OF CONFUSION */
+	private MetaDataPropertyName propertyName;
+	private String value;
+
+
+	/**
+	 * Method to retrieve a CDM Libraries meta data
+	 * @return
+	 */
+	public static final List<CdmMetaData> propertyList(){
+		List<CdmMetaData> result = new ArrayList<CdmMetaData>();
+		result.add(new CdmMetaData(MetaDataPropertyName.DB_SCHEMA_VERSION, dbSchemaVersion));
+		result.add(new CdmMetaData(MetaDataPropertyName.TERMS_VERSION, termsVersion));
+		result.add(new CdmMetaData(MetaDataPropertyName.DB_CREATE_DATE, new DateTime().toString()));
+		return result;
+	}
+
+//********************* Constructor *********************************************/
+
+	/**
+	 * Simple constructor to be used by Spring
+	 */
+	protected CdmMetaData(){
+		super();
+	}
+
+	public CdmMetaData(MetaDataPropertyName propertyName, String value) {
+		super();
+		this.propertyName = propertyName;
+		this.value = value;
+	}
+
+//****************** instance methods ****************************************/
+
+	/**
+	 * @return the propertyName
+	 */
+	public MetaDataPropertyName getPropertyName() {
+		return propertyName;
+	}
+
+	/**
+	 * @param propertyName the propertyName to set
+	 */
+	public void setPropertyName(MetaDataPropertyName propertyName) {
+		this.propertyName = propertyName;
+	}
+
+	/**
+	 * @return the value
+	 */
+	public String getValue() {
+		return value;
+	}
+
+	/**
+	 * @param value the value to set
+	 */
+	public void setValue(String value) {
+		this.value = value;
+	}
+
+//******************** Version comparator **********************************/
+
+	public static class VersionComparator implements Comparator<String>{
+		Integer depth;
+		IProgressMonitor monitor;
+
+		public VersionComparator(Integer depth, IProgressMonitor monitor){
+			this.depth = depth;
+			this.monitor = monitor;
+		}
+
+		/* (non-Javadoc)
+		 * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
+		 */
+		@Override
+        public int compare(String version1, String version2) {
+			int result = 0;
+			String[] version1Split = version1.split("\\.");
+			String[] version2Split = version2.split("\\.");
+
+			if(version1Split.length == 1 || version2Split.length == 1){
+				throwException("Tried to compare version but given Strings don't seem to " +
+						"contain version numbers. version1: " + version1 + ", version2:" + version2);
+			}
+
+			if(depth != null && (version1Split.length < depth || version2Split.length < depth )){
+				throwException("Desired depth can not be achieved with the given strings. depth: " + depth  + ", version1: " + version1 + ", version2:" + version2);
+			}
+
+			int length = (depth == null ||version1Split.length < depth) ? version1Split.length : depth;
+			for (int i = 0; i < length; i++){
+				Long version1Part = Long.valueOf(version1Split[i]);
+				Long version2Part = Long.valueOf(version2Split[i]);
+				int partCompare = version1Part.compareTo(version2Part);
+				if (partCompare != 0){
+					return partCompare;
+				}
+			}
+			return result;
+		}
+
+		private Throwable throwException(String message){
+			RuntimeException exception =  new RuntimeException(message);
+			if (monitor != null){
+				monitor.warning(message, exception);
+			}
+			throw exception;
+		}
+
+	}
+
+	/**
+	 * Compares two version string. If version1 is higher than version2 a positive result is returned.
+	 * If both are equal 0 is returned, otherwise -1 is returned.
+	 * @see Comparator#compare(Object, Object)
+	 * @param version1
+	 * @param version2
+	 * @param depth
+	 * @param monitor
+	 * @return
+	 */
+	public static int compareVersion(String version1, String version2, Integer depth, IProgressMonitor monitor){
+		VersionComparator versionComparator = new VersionComparator(depth, monitor);
+		return versionComparator.compare(version1, version2);
+	}
+
+	public static boolean isDbSchemaVersionCompatible(String version){
+		return compareVersion(dbSchemaVersion, version, 3, null) == 0;
+	}
+
+	public static String getDbSchemaVersion() {
+		return dbSchemaVersion;
+	}
+
+	public static String getTermsVersion() {
+		return termsVersion;
+	}
+
+	public static boolean isTermsVersionCompatible(String version){
+		return compareVersion(termsVersion, version, 3, null) == 0;
+	}
+
+}
diff --git a/cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/update/CdmUpdater.java b/cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/update/CdmUpdater.java
index 78f545347d..fce75366e5 100644
--- a/cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/update/CdmUpdater.java
+++ b/cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/update/CdmUpdater.java
@@ -18,8 +18,8 @@ import eu.etaxonomy.cdm.common.monitor.DefaultProgressMonitor;
 import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
 import eu.etaxonomy.cdm.database.CdmDataSource;
 import eu.etaxonomy.cdm.database.ICdmDataSource;
-import eu.etaxonomy.cdm.database.update.v35_36.SchemaUpdater_35_36;
-import eu.etaxonomy.cdm.database.update.v35_36.TermUpdater_35_36;
+import eu.etaxonomy.cdm.database.update.v36_40.SchemaUpdater_36_40;
+import eu.etaxonomy.cdm.database.update.v36_40.TermUpdater_36_40;
 import eu.etaxonomy.cdm.model.metadata.CdmMetaData;
 
 /**
@@ -77,7 +77,7 @@ public class CdmUpdater {
 
 
     private ITermUpdater getCurrentTermUpdater() {
-        return TermUpdater_35_36.NewInstance();
+        return TermUpdater_36_40.NewInstance();
     }
 
     /**
@@ -85,7 +85,7 @@ public class CdmUpdater {
      * @return
      */
     private ISchemaUpdater getCurrentSchemaUpdater() {
-        return SchemaUpdater_35_36.NewInstance();
+        return SchemaUpdater_36_40.NewInstance();
     }
 
     /**
diff --git a/cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/update/v35_36/SchemaUpdater_35_36.java b/cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/update/v35_36/SchemaUpdater_35_36.java
index 0bc9278148..59dfaf98c1 100644
--- a/cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/update/v35_36/SchemaUpdater_35_36.java
+++ b/cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/update/v35_36/SchemaUpdater_35_36.java
@@ -24,6 +24,7 @@ import eu.etaxonomy.cdm.database.update.SchemaUpdaterBase;
 import eu.etaxonomy.cdm.database.update.TableCreator;
 import eu.etaxonomy.cdm.database.update.UniqueIndexDropper;
 import eu.etaxonomy.cdm.database.update.v34_35.SchemaUpdater_341_35;
+import eu.etaxonomy.cdm.database.update.v36_40.SchemaUpdater_36_40;
 
 /**
  * @author a.mueller
@@ -190,7 +191,7 @@ public class SchemaUpdater_35_36 extends SchemaUpdaterBase {
 
 	@Override
 	public ISchemaUpdater getNextUpdater() {
-		return null;
+		return SchemaUpdater_36_40.NewInstance();
 	}
 
 	@Override
diff --git a/cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/update/v35_36/TermUpdater_35_36.java b/cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/update/v35_36/TermUpdater_35_36.java
index 8b2b0a2a89..ef7b68b8dd 100644
--- a/cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/update/v35_36/TermUpdater_35_36.java
+++ b/cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/update/v35_36/TermUpdater_35_36.java
@@ -1,82 +1,83 @@
-// $Id$
-/**
-* Copyright (C) 2009 EDIT
-* European Distributed Institute of Taxonomy 
-* http://www.e-taxonomy.eu
-* 
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
-package eu.etaxonomy.cdm.database.update.v35_36;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-import eu.etaxonomy.cdm.database.update.ITermUpdater;
-import eu.etaxonomy.cdm.database.update.ITermUpdaterStep;
-import eu.etaxonomy.cdm.database.update.TermUpdaterBase;
-import eu.etaxonomy.cdm.database.update.v34_35.TermUpdater_34_35;
-
-/**
- * @author a.mueller
- * @date 10.09.2010
- *
- */
-public class TermUpdater_35_36 extends TermUpdaterBase implements ITermUpdater {
-	@SuppressWarnings("unused")
-	private static final Logger logger = Logger.getLogger(TermUpdater_35_36.class);
-	
-	public static final String endTermVersion = "3.6.0.0.201527040000";
-	private static final String startTermVersion = "3.5.0.0.201531030000";
-	
-// *************************** FACTORY **************************************/
-	
-	public static TermUpdater_35_36 NewInstance(){
-		return new TermUpdater_35_36(startTermVersion, endTermVersion);
-	}
-	
-// *************************** CONSTRUCTOR ***********************************/	
-
-	protected TermUpdater_35_36(String startTermVersion, String endTermVersion) {
-		super(startTermVersion, endTermVersion);
-	}
-	
-	
-	@Override
-	protected List<ITermUpdaterStep> getUpdaterList() {
-		List<ITermUpdaterStep> list = new ArrayList<ITermUpdaterStep>();
-
-//		// proles, #2793
-//		UUID uuidTerm = UUID.fromString("8810d1ba-6a34-4ae3-a355-919ccd1cd1a5");
-//		String description = "Rank ''Proles''. Note: This rank is not compliant with the current nomenclatural codes";
-//		String label = "Proles";
-//		String abbrev = "prol.";
-//		String dtype = Rank.class.getSimpleName();
-//		boolean isOrdered = true;
-//		UUID uuidVocabulary = UUID.fromString("ef0d1ce1-26e3-4e83-b47b-ca74eed40b1b");
-//		UUID uuidAfterTerm = UUID.fromString("bff22f84-553a-4429-a4e7-c4b3796c3a18");
-//		UUID uuidLang = Language.uuidEnglish;
-//		RankClass rankClass = RankClass.Infraspecific;
-//		String stepName = "Add 'proles' rank to ranks";
-//		TermType termType = TermType.Rank;
-//		list.add( SingleTermUpdater.NewInstance(stepName, termType, uuidTerm, abbrev, description, label, abbrev, dtype, uuidVocabulary, uuidLang, isOrdered, uuidAfterTerm).setRankClass(rankClass));
-
-		//there are some more new vocabularies, but we trust that the term initializer will 
-		//initialize and persist them correctly
-		
-		return list;
-	}
-	
-	@Override
-	public ITermUpdater getNextUpdater() {
-		return null;
-	}
-
-	@Override
-	public ITermUpdater getPreviousUpdater() {
-		return TermUpdater_34_35.NewInstance();
-	}
-
-}
+// $Id$
+/**
+* Copyright (C) 2009 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.cdm.database.update.v35_36;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+
+import eu.etaxonomy.cdm.database.update.ITermUpdater;
+import eu.etaxonomy.cdm.database.update.ITermUpdaterStep;
+import eu.etaxonomy.cdm.database.update.TermUpdaterBase;
+import eu.etaxonomy.cdm.database.update.v34_35.TermUpdater_34_35;
+import eu.etaxonomy.cdm.database.update.v36_40.TermUpdater_36_40;
+
+/**
+ * @author a.mueller
+ * @date 10.09.2010
+ *
+ */
+public class TermUpdater_35_36 extends TermUpdaterBase {
+	@SuppressWarnings("unused")
+	private static final Logger logger = Logger.getLogger(TermUpdater_35_36.class);
+
+	public static final String endTermVersion = "3.6.0.0.201527040000";
+	private static final String startTermVersion = "3.5.0.0.201531030000";
+
+// *************************** FACTORY **************************************/
+
+	public static TermUpdater_35_36 NewInstance(){
+		return new TermUpdater_35_36(startTermVersion, endTermVersion);
+	}
+
+// *************************** CONSTRUCTOR ***********************************/
+
+	protected TermUpdater_35_36(String startTermVersion, String endTermVersion) {
+		super(startTermVersion, endTermVersion);
+	}
+
+
+	@Override
+	protected List<ITermUpdaterStep> getUpdaterList() {
+		List<ITermUpdaterStep> list = new ArrayList<ITermUpdaterStep>();
+
+//		// proles, #2793
+//		UUID uuidTerm = UUID.fromString("8810d1ba-6a34-4ae3-a355-919ccd1cd1a5");
+//		String description = "Rank ''Proles''. Note: This rank is not compliant with the current nomenclatural codes";
+//		String label = "Proles";
+//		String abbrev = "prol.";
+//		String dtype = Rank.class.getSimpleName();
+//		boolean isOrdered = true;
+//		UUID uuidVocabulary = UUID.fromString("ef0d1ce1-26e3-4e83-b47b-ca74eed40b1b");
+//		UUID uuidAfterTerm = UUID.fromString("bff22f84-553a-4429-a4e7-c4b3796c3a18");
+//		UUID uuidLang = Language.uuidEnglish;
+//		RankClass rankClass = RankClass.Infraspecific;
+//		String stepName = "Add 'proles' rank to ranks";
+//		TermType termType = TermType.Rank;
+//		list.add( SingleTermUpdater.NewInstance(stepName, termType, uuidTerm, abbrev, description, label, abbrev, dtype, uuidVocabulary, uuidLang, isOrdered, uuidAfterTerm).setRankClass(rankClass));
+
+		//there are some more new vocabularies, but we trust that the term initializer will
+		//initialize and persist them correctly
+
+		return list;
+	}
+
+	@Override
+	public ITermUpdater getNextUpdater() {
+		return TermUpdater_36_40.NewInstance();
+	}
+
+	@Override
+	public ITermUpdater getPreviousUpdater() {
+		return TermUpdater_34_35.NewInstance();
+	}
+
+}
diff --git a/cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/update/v36_40/SchemaUpdater_36_40.java b/cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/update/v36_40/SchemaUpdater_36_40.java
new file mode 100644
index 0000000000..9cac8c20c3
--- /dev/null
+++ b/cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/update/v36_40/SchemaUpdater_36_40.java
@@ -0,0 +1,80 @@
+// $Id$
+/**
+ * Copyright (C) 2007 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+
+package eu.etaxonomy.cdm.database.update.v36_40;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+
+import eu.etaxonomy.cdm.database.update.ISchemaUpdater;
+import eu.etaxonomy.cdm.database.update.ISchemaUpdaterStep;
+import eu.etaxonomy.cdm.database.update.SchemaUpdaterBase;
+import eu.etaxonomy.cdm.database.update.v35_36.SchemaUpdater_35_36;
+
+/**
+ * @author a.mueller
+ * @created 16.04.2016
+ */
+public class SchemaUpdater_36_40 extends SchemaUpdaterBase {
+
+	@SuppressWarnings("unused")
+	private static final Logger logger = Logger.getLogger(SchemaUpdater_36_40.class);
+	private static final String endSchemaVersion = "4.0.0.0.201604200000";
+	private static final String startSchemaVersion = "3.6.0.0.201527040000";
+
+	// ********************** FACTORY METHOD *************************************
+
+	public static SchemaUpdater_36_40 NewInstance() {
+		return new SchemaUpdater_36_40();
+	}
+
+	/**
+	 * @param startSchemaVersion
+	 * @param endSchemaVersion
+	 */
+	protected SchemaUpdater_36_40() {
+		super(startSchemaVersion, endSchemaVersion);
+	}
+
+	@Override
+	protected List<ISchemaUpdaterStep> getUpdaterList() {
+
+		String stepName;
+		String tableName;
+		ISchemaUpdaterStep step;
+//		String columnName;
+		String newColumnName;
+		String oldColumnName;
+		String columnNames[];
+		String referencedTables[];
+		String columnTypes[];
+//		boolean includeCdmBaseAttributes = false;
+
+		List<ISchemaUpdaterStep> stepList = new ArrayList<ISchemaUpdaterStep>();
+
+
+
+		return stepList;
+	}
+
+
+	@Override
+	public ISchemaUpdater getNextUpdater() {
+		return null;
+	}
+
+	@Override
+	public ISchemaUpdater getPreviousUpdater() {
+		return SchemaUpdater_35_36.NewInstance();
+	}
+
+}
diff --git a/cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/update/v36_40/TermUpdater_36_40.java b/cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/update/v36_40/TermUpdater_36_40.java
new file mode 100644
index 0000000000..ee8e69a382
--- /dev/null
+++ b/cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/update/v36_40/TermUpdater_36_40.java
@@ -0,0 +1,82 @@
+// $Id$
+/**
+* Copyright (C) 2009 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.cdm.database.update.v36_40;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+
+import eu.etaxonomy.cdm.database.update.ITermUpdater;
+import eu.etaxonomy.cdm.database.update.ITermUpdaterStep;
+import eu.etaxonomy.cdm.database.update.TermUpdaterBase;
+import eu.etaxonomy.cdm.database.update.v35_36.TermUpdater_35_36;
+
+/**
+ * @author a.mueller
+ * @date 16.04.2016
+ *
+ */
+public class TermUpdater_36_40 extends TermUpdaterBase {
+	@SuppressWarnings("unused")
+	private static final Logger logger = Logger.getLogger(TermUpdater_36_40.class);
+
+	public static final String startTermVersion = "3.6.0.0.201527040000";
+	private static final String endTermVersion = "4.0.0.0.201604200000";
+
+// *************************** FACTORY **************************************/
+
+	public static TermUpdater_36_40 NewInstance(){
+		return new TermUpdater_36_40(startTermVersion, endTermVersion);
+	}
+
+// *************************** CONSTRUCTOR ***********************************/
+
+	protected TermUpdater_36_40(String startTermVersion, String endTermVersion) {
+		super(startTermVersion, endTermVersion);
+	}
+
+
+	@Override
+	protected List<ITermUpdaterStep> getUpdaterList() {
+		List<ITermUpdaterStep> list = new ArrayList<ITermUpdaterStep>();
+
+//		// proles, #2793
+//		UUID uuidTerm = UUID.fromString("8810d1ba-6a34-4ae3-a355-919ccd1cd1a5");
+//		String description = "Rank ''Proles''. Note: This rank is not compliant with the current nomenclatural codes";
+//		String label = "Proles";
+//		String abbrev = "prol.";
+//		String dtype = Rank.class.getSimpleName();
+//		boolean isOrdered = true;
+//		UUID uuidVocabulary = UUID.fromString("ef0d1ce1-26e3-4e83-b47b-ca74eed40b1b");
+//		UUID uuidAfterTerm = UUID.fromString("bff22f84-553a-4429-a4e7-c4b3796c3a18");
+//		UUID uuidLang = Language.uuidEnglish;
+//		RankClass rankClass = RankClass.Infraspecific;
+//		String stepName = "Add 'proles' rank to ranks";
+//		TermType termType = TermType.Rank;
+//		list.add( SingleTermUpdater.NewInstance(stepName, termType, uuidTerm, abbrev, description, label, abbrev, dtype, uuidVocabulary, uuidLang, isOrdered, uuidAfterTerm).setRankClass(rankClass));
+
+		//there are some more new vocabularies, but we trust that the term initializer will
+		//initialize and persist them correctly
+
+		return list;
+	}
+
+	@Override
+	public ITermUpdater getNextUpdater() {
+		return null;
+	}
+
+	@Override
+	public ITermUpdater getPreviousUpdater() {
+		return TermUpdater_35_36.NewInstance();
+	}
+
+}
