ALF-10772: schema comparator

Compares two abstract database schemas.



git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@31312 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Matt Ward
2011-10-18 11:42:57 +00:00
parent 4cde60f0e6
commit 2a5a337b4e
14 changed files with 799 additions and 139 deletions

View File

@@ -18,8 +18,12 @@
*/
package org.alfresco.util.schemacomp.model;
import org.alfresco.util.schemacomp.Differences;
import org.alfresco.util.schemacomp.SchemaUtils;
/**
* TODO: comment me!
* Represents a column in a database table.
*
* @author Matt Ward
*/
public class Column extends AbstractDbObject
@@ -27,6 +31,21 @@ public class Column extends AbstractDbObject
private String type;
private boolean nullable;
/**
* Construct a Column.
*
* @param name
* @param type
* @param nullable
*/
public Column(String name, String type, boolean nullable)
{
super(name);
this.type = type;
this.nullable = nullable;
}
/**
* @return the type
*/
@@ -84,4 +103,12 @@ public class Column extends AbstractDbObject
else if (!this.type.equals(other.type)) return false;
return true;
}
@Override
protected void doDiff(DbObject right, Differences differences)
{
Column rightColumn = (Column) right;
SchemaUtils.compareSimple(type, rightColumn.type, differences);
SchemaUtils.compareSimple(nullable, rightColumn.nullable, differences);
}
}