Revision: 3907
Author: [email protected]
Date: Fri Aug 20 09:35:41 2010
Log: Reverse engineering tables no longer creates its child table's columns
and indices. Foreign key columns and indices are only created if the
foreign key table is reverse engineered. This change should improve
performance.
http://code.google.com/p/power-architect/source/detail?r=3907
Modified:
/trunk/src/main/java/ca/sqlpower/architect/ProjectLoader.java
/trunk/src/main/java/ca/sqlpower/architect/swingui/SwingUIProjectLoader.java
=======================================
--- /trunk/src/main/java/ca/sqlpower/architect/ProjectLoader.java Tue Jul
20 15:43:01 2010
+++ /trunk/src/main/java/ca/sqlpower/architect/ProjectLoader.java Fri Aug
20 09:35:41 2010
@@ -842,6 +842,16 @@
if (pkColumnId != null) {
cmap.setPkColumn((SQLColumn)
sqlObjectLoadIdMap.get(pkColumnId));
}
+
+ String fkTableId = attributes.getValue("fk-table");
+ if (fkTableId != null) {
+ cmap.setFkTable((SQLTable)
sqlObjectLoadIdMap.get(fkTableId));
+ }
+
+ String fkColName = attributes.getValue("fk-col-name");
+ if (fkColName != null) {
+ cmap.setFkColName(fkColName);
+ }
return cmap;
}
=======================================
---
/trunk/src/main/java/ca/sqlpower/architect/swingui/SwingUIProjectLoader.java
Thu Jul 29 14:36:01 2010
+++
/trunk/src/main/java/ca/sqlpower/architect/swingui/SwingUIProjectLoader.java
Fri Aug 20 09:35:41 2010
@@ -1481,6 +1481,8 @@
type = "column-mapping"; //$NON-NLS-1$
propNames.put("pk-column-ref",
sqlObjectSaveIdMap.get(((SQLRelationship.ColumnMapping) o).getPkColumn()));
//$NON-NLS-1$
propNames.put("fk-column-ref",
sqlObjectSaveIdMap.get(((SQLRelationship.ColumnMapping) o).getFkColumn()));
//$NON-NLS-1$
+ propNames.put("fk-col-name", ((SQLRelationship.ColumnMapping)
o).getFkColName()); //$NON-NLS-1$
+ propNames.put("fk-table",
sqlObjectSaveIdMap.get(((SQLRelationship.ColumnMapping) o).getFkTable()));
//$NON-NLS-1$
} else if (o instanceof SQLIndex) {
id = "IDX"+sqlObjectSaveIdMap.size(); //$NON-NLS-1$
type = "index"; //$NON-NLS-1$