ALF-11668: Add position identifiers (same as seq elements in current schema dump tool)

As for current schemadump tool, table columns and primary key column names have order associated with them.



git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@32296 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Matt Ward
2011-11-24 18:17:41 +00:00
parent f939783d70
commit 462994f3eb
16 changed files with 503 additions and 313 deletions

View File

@@ -20,6 +20,7 @@ package org.alfresco.util.schemacomp;
import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
@@ -84,6 +85,7 @@ public class SchemaCompTestingUtils
{
String[] parts = colDefs[i].split(" ");
columns[i] = new Column(null, parts[0], parts[1], false);
columns[i].setOrder(i+1);
}
return Arrays.asList(columns);
}
@@ -91,7 +93,14 @@ public class SchemaCompTestingUtils
public static PrimaryKey pk(String name, String... columnNames)
{
assertTrue("No columns specified", columnNames.length > 0);
PrimaryKey pk = new PrimaryKey(null, name, Arrays.asList(columnNames));
// Create a list of column orders, ordered the same as the supplied column names
// i.e. 1, 2, 3... N
List<Integer> columnOrders = new ArrayList<Integer>(columnNames.length);
for (int i = 1; i <= columnNames.length; i++)
{
columnOrders.add(i);
}
PrimaryKey pk = new PrimaryKey(null, name, Arrays.asList(columnNames), columnOrders);
return pk;
}