ALF-10771: schema validation and differences rules

Laying some groundwork for the main code.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@31921 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Matt Ward
2011-11-14 10:16:59 +00:00
parent 60688d34b9
commit 4c863f5e0a
16 changed files with 165 additions and 84 deletions

View File

@@ -122,17 +122,24 @@ public class Index extends AbstractDbObject
{
Index other = (Index) o;
if (getName() != null)
// An index can only be 'the same' if it belongs to the correct table.
if (!getParent().sameAs(other.getParent()))
{
if (getName().equals(other.getName()))
{
return true;
}
else
{
return columnNames.equals(other.getColumnNames());
}
return false;
}
// If it has the same name, then it is intended to be the same index
if (getName() != null && getName().equals(other.getName()))
{
return true;
}
else
{
// The name may be different, but if it has the same parent table (see above)
// and indexes the same columns, then it is the same index.
return columnNames.equals(other.getColumnNames());
}
}
return false;