diff options
author | nhauge | 2009-11-16 22:09:52 +0000 |
---|---|---|
committer | nhauge | 2009-11-16 22:09:52 +0000 |
commit | 4c5fde0b54f9141b00908a23100deee086f1dcf2 (patch) | |
tree | c779e9eb180c17bf3ab84358947ecd645aa5c711 /jpa/plugins | |
parent | 9ce61b15dd95748934672a5fd947bb18a392de8c (diff) | |
download | webtools.dali-4c5fde0b54f9141b00908a23100deee086f1dcf2.tar.gz webtools.dali-4c5fde0b54f9141b00908a23100deee086f1dcf2.tar.xz webtools.dali-4c5fde0b54f9141b00908a23100deee086f1dcf2.zip |
288027 - add product customization preference logic to filter out synonyms where adopter specifically wish to exclude them from Dali functionality. This filtering code ended up here since it was the only way to universally exclude synonyms from Dali.
Diffstat (limited to 'jpa/plugins')
-rw-r--r-- | jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPSchemaWrapper.java | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPSchemaWrapper.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPSchemaWrapper.java index afdb7ea448..11f90e55c4 100644 --- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPSchemaWrapper.java +++ b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPSchemaWrapper.java @@ -9,10 +9,14 @@ ******************************************************************************/ package org.eclipse.jpt.db.internal; +import java.util.ArrayList; import java.util.Comparator; import java.util.Iterator; import java.util.List; +import org.eclipse.core.runtime.Platform; +import org.eclipse.datatools.modelbase.sql.tables.SQLTablesPackage; + import org.eclipse.jpt.db.Schema; import org.eclipse.jpt.db.Sequence; import org.eclipse.jpt.db.Table; @@ -38,6 +42,12 @@ final class DTPSchemaWrapper // lazy-initialized private DTPSequenceWrapper[] sequences; + + // ********** constants ********** + + //used for adopter product customization + private static final String PERSISTENT_AND_VIEW_TABLES_ONLY = "supportPersistentAndViewTablesOnly"; + // ********** constructor ********** @@ -103,7 +113,27 @@ final class DTPSchemaWrapper // minimize scope of suppressed warnings @SuppressWarnings("unchecked") private List<org.eclipse.datatools.modelbase.sql.tables.Table> getDTPTables() { - return this.dtpSchema.getTables(); + + //if product customization flag is set to true return only persistent and view tables. + //this will filter out synonyms where they are not fully supported and potentially other + //problematic table types - see bug 269057 + String supportPersistentAndViewTablesOnly = Platform.getProduct().getProperty(PERSISTENT_AND_VIEW_TABLES_ONLY); + if ( supportPersistentAndViewTablesOnly != null && supportPersistentAndViewTablesOnly.equals("true") ) { + List<org.eclipse.datatools.modelbase.sql.tables.Table> result = + new ArrayList<org.eclipse.datatools.modelbase.sql.tables.Table>(); + for (Iterator iterT = this.dtpSchema.getTables().iterator();iterT.hasNext();) { + org.eclipse.datatools.modelbase.sql.tables.Table table + = (org.eclipse.datatools.modelbase.sql.tables.Table) iterT.next(); + if (SQLTablesPackage.eINSTANCE.getPersistentTable().isSuperTypeOf(table.eClass()) || + SQLTablesPackage.eINSTANCE.getViewTable().isSuperTypeOf(table.eClass()) ) { + result.add(table); + } + } + return result; + } + else { + return this.dtpSchema.getTables(); + } } public int tablesSize() { @@ -315,5 +345,4 @@ final class DTPSchemaWrapper } this.tables = null; } - } |