mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user