Schema comparator: added optional <schema> level attribute to allow ignoring of table column ordering during schema validation.

<schema ... tablecolumnorder="false">

The above snippet will disable column order checking for tables.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@46517 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Matt Ward
2013-02-12 15:03:01 +00:00
parent 89e6592f85
commit 1270a56c47
13 changed files with 210 additions and 21 deletions

View File

@@ -40,6 +40,7 @@ public class Schema extends AbstractDbObject implements Iterable<DbObject>
protected final List<DbObject> objects = new ArrayList<DbObject>();
protected final String dbPrefix;
protected final int version;
protected final boolean checkTableColumnOrder;
/**
* Construct a schema with the given name and no database prefix.
@@ -48,7 +49,7 @@ public class Schema extends AbstractDbObject implements Iterable<DbObject>
*/
public Schema(String name)
{
this(name, "", 0);
this(name, "", 0, true);
}
/**
@@ -61,12 +62,13 @@ public class Schema extends AbstractDbObject implements Iterable<DbObject>
* @param name
* @param dbPrefix
*/
public Schema(String name, String dbPrefix, int schemaVersion)
public Schema(String name, String dbPrefix, int schemaVersion, boolean checkTableColumnOrder)
{
super(null, name);
ParameterCheck.mandatory("dbPrefix", dbPrefix);
this.dbPrefix = dbPrefix;
this.version = schemaVersion;
this.checkTableColumnOrder = checkTableColumnOrder;
addDefaultValidators();
}
@@ -129,6 +131,14 @@ public class Schema extends AbstractDbObject implements Iterable<DbObject>
return this.version;
}
/**
* @return the checkTableColumnOrder
*/
public boolean isCheckTableColumnOrder()
{
return this.checkTableColumnOrder;
}
@Override
public int hashCode()
{