Author: dgeraskov
Date: 2008-03-04 07:06:01 -0500 (Tue, 04 Mar 2008)
New Revision: 6677
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/LazyDatabaseSchemaWorkbenchAdapter.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1837
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/LazyDatabaseSchemaWorkbenchAdapter.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/LazyDatabaseSchemaWorkbenchAdapter.java 2008-03-04
12:00:38 UTC (rev 6676)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/LazyDatabaseSchemaWorkbenchAdapter.java 2008-03-04
12:06:01 UTC (rev 6677)
@@ -55,23 +55,29 @@
final DefaultDatabaseCollector db = new DefaultDatabaseCollector();
ConsoleConfiguration consoleConfiguration = dbs.getConsoleConfiguration();
- readDatabaseSchema(monitor, db, consoleConfiguration,
dbs.getReverseEngineeringStrategy());
-
- List result = new ArrayList();
-
- Iterator qualifierEntries = db.getQualifierEntries();
- while ( qualifierEntries.hasNext() ) {
- Map.Entry entry = (Map.Entry) qualifierEntries.next();
- result.add(new TableContainer((String) entry.getKey(),(List)entry.getValue()));
+ try{
+ readDatabaseSchema(monitor, db, consoleConfiguration,
dbs.getReverseEngineeringStrategy());
+
+ List result = new ArrayList();
+
+ Iterator qualifierEntries = db.getQualifierEntries();
+ while ( qualifierEntries.hasNext() ) {
+ Map.Entry entry = (Map.Entry) qualifierEntries.next();
+ result.add(new TableContainer((String) entry.getKey(),(List)entry.getValue()));
+ }
+ return toArray(result.iterator(), TableContainer.class, new Comparator() {
+
+ public int compare(Object arg0, Object arg1) {
+
+ return
((TableContainer)arg0).getName().compareTo(((TableContainer)arg1).getName());
+ }
+
+ });
+ } catch (HibernateException e){
+ HibernateConsolePlugin.getDefault().logErrorMessage("Problems while reading
database schema", e);
+ return new Object[]{"<Reading schema error: " + e.getMessage() +
">"};
}
- return toArray(result.iterator(), TableContainer.class, new Comparator() {
- public int compare(Object arg0, Object arg1) {
-
- return ((TableContainer)arg0).getName().compareTo(((TableContainer)arg1).getName());
- }
-
- });
}
private LazyDatabaseSchema getLazyDatabaseSchema(Object o) {